local UserInputService = game:GetService('UserInputService') local RunService = game:GetService('RunService') local Players = game:GetService('Players') local Circle = Drawing.new('Circle') Circle.Thickness = 1 Circle.Position = UserInputService:GetMouseLocation() Circle.Visible = true Circle.Filled = false Circle.Radius = 200 Circle.Color = Color3.fromRGB(255, 255, 255) local Line = Drawing.new('Line') Line.Thickness = 1 Line.Visible = false Line.Color = Color3.fromRGB(255, 255, 255) Line.From = UserInputService:GetMouseLocation() function GetClosestTarget() local Target, Distance = nil, math.huge -- for Index, Value in next, Players:GetPlayers() do if Value == Players.LocalPlayer or Value.Team == Players.LocalPlayer.Team or Value.Team == 'Spectator' then continue end if not Players.LocalPlayer.Character or not Players.LocalPlayer.Character:FindFirstChild('Head') then continue end -- local Character = Value.Character if not Character then continue end -- local Humanoid = Character:FindFirstChildOfClass('Humanoid') if not Humanoid or Humanoid.Health <= 0 then continue end -- local ScreenPosition, OnScreen = workspace.CurrentCamera:WorldToViewportPoint(Character:FindFirstChild('Head').Position) if not OnScreen or (Vector2.new(ScreenPosition.X, ScreenPosition.Y) - UserInputService:GetMouseLocation()).Magnitude > 200 then continue end -- local ObscuringTarget = #workspace.CurrentCamera:GetPartsObscuringTarget({workspace.CurrentCamera.CFrame.Position, Character:FindFirstChild('Head').Position}, {Players.LocalPlayer.Character, Character}) --if ObscuringTarget > 0 then continue end -- if (Character:FindFirstChild('Head').Position - Players.LocalPlayer.Character:FindFirstChild('Head').Position).Magnitude < Distance then Target = Character:FindFirstChild('Head') Distance = (Character:FindFirstChild('Head').Position - Players.LocalPlayer.Character:FindFirstChild('Head').Position).Magnitude end end -- return Target end for Index, Value in next, getgc(true) do if typeof(Value) == 'function' and not isexecutorclosure(Value) and not iscclosure(Value) and islclosure(Value) and debug.getinfo(Value).name ~= nil then if debug.getinfo(Value).name == 'BulletRayCast' then local Hook; Hook = hookfunction(Value, newcclosure(function(...) local Args = {...} -- local Target = GetClosestTarget() if Target then Args[2] = (Target.Position - Args[1]).Unit end -- return Hook(table.unpack(Args)) end)) end end end RunService.Heartbeat:Connect(function() Circle.Position = UserInputService:GetMouseLocation() Line.From = UserInputService:GetMouseLocation() -- local Target = GetClosestTarget() if Target then local ScreenPosition, OnScreen = workspace.CurrentCamera:WorldToViewportPoint(Target.Position) if not OnScreen then return end -- Line.Visible = true Line.To = Vector2.new(ScreenPosition.X, ScreenPosition.Y) else Line.Visible = false end end)