0% found this document useful (0 votes)
59 views1 page

For Roblox!!

This Lua script checks if other players are visible to the local player, gets the equipped weapon, and fires a hit event at the visible player's head if they are within range, waiting the appropriate fire rate between shots.

Uploaded by

kermit the guy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views1 page

For Roblox!!

This Lua script checks if other players are visible to the local player, gets the equipped weapon, and fires a hit event at the visible player's head if they are within range, waiting the appropriate fire rate between shots.

Uploaded by

kermit the guy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

local function PLR_VISIBLE(plr)

local IgnoreList = {game:GetService("Players").LocalPlayer.Character}


local NewRay = Ray.new(workspace.CurrentCamera.CFrame.p,
(plr.Character.HumanoidRootPart.Position - workspace.CurrentCamera.CFrame.p).unit *
2048)
local FindPart = workspace:FindPartOnRayWithIgnoreList(NewRay, IgnoreList)

if FindPart and FindPart:IsDescendantOf(plr.Character) then


return true
end

return false
end

while true do
wait()
pcall(function()
for i,v in pairs(game.Players:GetPlayers()) do
if v.Team ~= game.Players.LocalPlayer.Team and v.Character and
v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health > 0 and
PLR_VISIBLE(v) == true then
local WeaponName =
game.Players.LocalPlayer.Character.EquippedTool.Value

if game.ReplicatedStorage.Weapons[WeaponName]:FindFirstChild("Chamber")
and (game.Players.LocalPlayer.Character.HumanoidRootPart.Position -
v.Character.HumanoidRootPart.Position).magnitude > 10 then
return
end

game.ReplicatedStorage.Events.HitPart:FireServer(unpack({
[1] = v.Character.Head,
[2] = v.Character.Head.Position,
[3] = WeaponName,
[4] = 100,
[5] = game.Players.LocalPlayer.Character.Gun,
[6] = nil,
[7] = nil,
[8] = 1,
[9] = nil,
[10] = false,
[11] = Vector3.new(),
[12] = math.rad(1,100000),
[13] = Vector3.new()
}))

getsenv(game.Players.LocalPlayer.PlayerGui:WaitForChild("Client")).firebullet()
wait(game.ReplicatedStorage.Weapons[WeaponName].FireRate.Value)
end
end
end)
end

You might also like