Thank you for using our website
Your script:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local tools = {"AR", "Pistol", "Railgun", "Rocket Launcher", "SMG", "Shotgun", "Sniper", "Golden SMG", "Golden AR"}
RunService.RenderStepped:Connect(function()
for _, player in pairs(Players:GetPlayers()) do
if player.Name ~= Players.LocalPlayer.Name and player.Character and player.Character:FindFirstChild("Head") and player.Character.Humanoid.Health > 0 then
local plrp = player.Character.Head.Position
local dd = (plrp - Players.LocalPlayer.Character.HumanoidRootPart.Position).unit
local pptool
for _, plrtool in ipairs(tools) do pptool = Players.LocalPlayer.Backpack:FindFirstChild(plrtool) if pptool then break end end
local argsFire = {
[1] = pptool,
[2] = {
["id"] = 2,
["charge"] = 0,
["dir"] = dd,
["origin"] = Players.LocalPlayer.Character.HumanoidRootPart.Position
}
}
ReplicatedStorage.WeaponsSystem.Network.WeaponFired:FireServer(unpack(argsFire))
local argsHit = {
[1] = pptool,
[2] = {
["p"] = plrp,
["pid"] = 1,
["part"] = player.Character.Head,
["d"] = 1000,
["maxDist"] = 9007199254740991,
["h"] = player.Character.Humanoid,
["m"] = Enum.Material.Plastic,
["sid"] = 250,
["t"] = 0.5,
["n"] = Vector3.new(0, -1, 0)
}
}
ReplicatedStorage.WeaponsSystem.Network.WeaponHit:FireServer(unpack(argsHit))
task.wait()
end
end
end)