Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --loadstring(game:HttpGet('https://pastebin.com/raw/T97rTkBg', true))()
- local cc = game.workspace.CurrentCamera
- local mouse = game.Players.LocalPlayer:GetMouse()
- function getClosestMouse(trg_part)
- local nearest = nil
- local last = math.huge
- for i,v in pairs(game.Players:GetPlayers()) do
- if v ~= game.Players.LocalPlayer and game.Players.LocalPlayer.Character and v.Character and v.Character:FindFirstChild(trg_part) and v.TeamColor ~= game.Players.LocalPlayer.TeamColor then
- local ePos = cc:WorldToViewportPoint(v.Character[trg_part].Position)
- local AccPos = Vector2.new(ePos.x, ePos.y)
- local mousePos = Vector2.new(cc.ViewportSize.x / 2, cc.ViewportSize.y / 2)
- local distance = (AccPos - mousePos).magnitude
- if distance < last then
- last = distance
- nearest = v
- end
- end
- end
- if nearest ~= nil then
- return nearest
- end
- end
- local gameMeta = getrawmetatable(game)
- setreadonly(gameMeta, false)
- local oldNamecall = gameMeta.__namecall
- gameMeta.__namecall = newcclosure(function(remote, ...)
- local arguments = {...}
- if tostring(remote) == 'HitPart' then
- local getclose = getClosestMouse("Head")
- arguments[1] = getclose.Character.Head
- arguments[2] = getclose.Character.Head.Position
- return remote.FireServer(remote, unpack(arguments))
- end
- return oldNamecall(remote, ...)
- end)
Add Comment
Please, Sign In to add comment