Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local players, local_player, mouse, user_input_service, run_service, current_camera, mouse_location, teams, ts = game:GetService("Players"), game:GetService("Players").LocalPlayer, game:GetService("Players").LocalPlayer:GetMouse(), game:GetService("UserInputService"), game:GetService("RunService"), game:GetService("Workspace").CurrentCamera, game:GetService("UserInputService"):GetMouseLocation(), game:GetService("Teams"), require(game:GetService("ReplicatedStorage").TS)
- local old_index
- old_index = hookmetamethod(game, "__index", function(t, i)
- if i == "Character" then
- return ts.Characters:GetCharacter(t)
- elseif i == "Team" then
- return ts.Teams:GetPlayerTeam(t)
- end
- return old_index(t, i)
- end)
- local old = ts.Network.Fire
- ts.Network.Fire = function(self, name, ...)
- local args = {...}
- if getnamecallmethod() == "GetService" then
- return wait(9e9)
- end
- return old(self, name, ...)
- end
- local function closest_to_cursor()
- local target, max_distance = nil, 9e9
- for i, v in next, players:GetPlayers() do
- if v ~= local_player and v.Character and v.Character.Hitbox:FindFirstChild("Head") and v.Team ~= local_player.Team then
- local position, on_screen = current_camera:WorldToScreenPoint(v.Character.Hitbox.Head.Position)
- local distance = (Vector2.new(position.x, position.y) - Vector2.new(mouse.x, mouse.y)).Magnitude
- if distance < max_distance then
- target, max_distance = v, distance
- end
- end
- end
- return target
- end
- local old = ts.Raycast.CastGeometryAndEnemies
- ts.Raycast.CastGeometryAndEnemies = function(...)
- local args = {...}
- if closest_to_cursor() then
- args[3] = (closest_to_cursor().Character.Hitbox.Head.Position - args[2])
- end
- return old(unpack(args))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement