local Players = game:GetService("Players") local LocalPlayer = Players.LocalPlayer local Backpack = LocalPlayer:WaitForChild("Backpack") local RocketLauncher = Backpack:WaitForChild("RocketLauncher") local Activation = RocketLauncher:WaitForChild("Activation") local function getClosestEnemy() local closestEnemy, shortestDist = nil, math.huge local myChar = LocalPlayer.Character if not myChar or not myChar:FindFirstChild("HumanoidRootPart") then return nil end local myPos = myChar.HumanoidRootPart.Position for _, player in ipairs(Players:GetPlayers()) do if player ~= LocalPlayer and player.Team ~= LocalPlayer.Team then local char = player.Character if char and char:FindFirstChild("HumanoidRootPart") and char:FindFirstChildOfClass("Humanoid").Health > 0 then local dist = (char.HumanoidRootPart.Position - myPos).Magnitude if dist < shortestDist then shortestDist = dist closestEnemy = char end end end end return closestEnemy end local function aimAtEnemy() local enemy = getClosestEnemy() if enemy then Activation:FireServer("Aim", enemy.HumanoidRootPart.Position) end end while task.wait(1) do aimAtEnemy() end