You are on page 1of 1

local players,fireFunction = game:GetService('Players')

local plr = players.LocalPlayer

for i,v in pairs(getgc(true)) do


if type(v) == 'table' and rawget(v,'send') then
fireFunction = v.send
end
end

local function near()


local mag = math.huge
local near
for i,v in pairs(players:GetPlayers()) do
if v ~= plr and v.Character and v.Character:FindFirstChild('Head') then
local nMag = (plr.Character.HumanoidRootPart.Position -
v.Character.HumanoidRootPart.Position).Magnitude
if (nMag < mag) then
mag = nMag
near = v
end
end
end
return near
end

local sendHook; sendHook = hookfunction(fireFunction,function(...)


local args = {...}
if #args > 3 and near() then
args[3] = near().Character
args[4] = near().Character.Head
args[5] = near().Character.Head.Position
end
return sendHook(unpack(args))
end)

You might also like