--yeskid local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local LocalPlayer = Players.LocalPlayer local Remote = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("Game"):WaitForChild("FireShot") local shotId = 0 local function getClosestPart() local closestPart = nil local shortestDist = math.huge local cameraPos = workspace.CurrentCamera.CFrame.Position for _, player in ipairs(Players:GetPlayers()) do if player ~= LocalPlayer and player.Character then local character = player.Character local head = character:FindFirstChild("Head") local humanoid = character:FindFirstChildOfClass("Humanoid") if head and humanoid and humanoid.Health > 0 then local dist = (head.Position - cameraPos).Magnitude if dist < shortestDist then shortestDist = dist closestPart = head end end end end return closestPart end task.spawn(function() while true do local targetPart = getClosestPart() if targetPart then local char = LocalPlayer.Character if char and char:FindFirstChild("Head") then shotId = (shotId + 1) % 1000000 local origin = char.Head.Position local hitPosition = targetPart.Position local direction = (hitPosition - origin).Unit local args = { { direction = direction, hitPosition = hitPosition, origin = origin, clientTime = workspace:GetServerTimeNow(), hitPart = targetPart, shotId = shotId } } Remote:FireServer(unpack(args)) end end task.wait(0.15) end end)