local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local LocalPlayer = Players.LocalPlayer local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() local HRP = Character:WaitForChild("HumanoidRootPart") local HitRemote = ReplicatedStorage:WaitForChild("GameRemotes") :WaitForChild("Combat") :WaitForChild("Hit") local RANGE = 45 -- max distance local function getClosestPlayer() local closest = nil local shortestDistance = RANGE for _, player in ipairs(Players:GetPlayers()) do if player ~= LocalPlayer and player.Character then local targetHRP = player.Character:FindFirstChild("HumanoidRootPart") local torso = player.Character:FindFirstChild("Torso") or targetHRP if targetHRP and torso then local distance = (targetHRP.Position - HRP.Position).Magnitude if distance < shortestDistance then shortestDistance = distance closest = { torso = torso, hrp = targetHRP } end end end end return closest end while true do task.wait(0.15) local target = getClosestPlayer() if target then local direction = (target.hrp.Position - HRP.Position).Unit local args = { { Instance = target.torso, Normal = direction, Position = target.hrp.Position }, 16, "Cut", "0", "Right", target.hrp.Position } HitRemote:FireServer(unpack(args)) HitRemote:FireServer(unpack(args)) HitRemote:FireServer(unpack(args)) end end