-- Follow nearest player by walking (Humanoid:MoveTo) -- Delta Executor compatible local Players = game:GetService("Players") local RunService = game:GetService("RunService") local LocalPlayer = Players.LocalPlayer local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() local Humanoid = Character:WaitForChild("Humanoid") local HRP = Character:WaitForChild("HumanoidRootPart") local targetPlayer = nil -- Function to find nearest player with humanoid root part local function GetNearestPlayer() local nearest = nil local shortestDistance = math.huge for _, player in pairs(Players:GetPlayers()) do if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then local dist = (HRP.Position - player.Character.HumanoidRootPart.Position).Magnitude if dist < shortestDistance then shortestDistance = dist nearest = player end end end return nearest end -- Periodically update the target and move towards them while true do -- Update character references in case of respawn Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() Humanoid = Character:WaitForChild("Humanoid") HRP = Character:WaitForChild("HumanoidRootPart") targetPlayer = GetNearestPlayer() if targetPlayer and targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then local targetPos = targetPlayer.Character.HumanoidRootPart.Position -- Move to target's position Humanoid:MoveTo(targetPos) else -- No valid target, stop moving Humanoid:MoveTo(HRP.Position) end wait(0.5) -- update every 0.5 seconds to avoid spamming end