Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local localPlayer = Players.LocalPlayer
- local character = localPlayer.Character or localPlayer.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local rootPart = character:WaitForChild("HumanoidRootPart")
- local targetUsername = "AdoptMe9943"
- local function findTargetRootPart()
- for _, player in ipairs(Players:GetPlayers()) do
- if player.Name == targetUsername then
- local otherCharacter = player.Character
- if otherCharacter then
- local otherRootPart = otherCharacter:FindFirstChild("HumanoidRootPart")
- local otherHumanoid = otherCharacter:FindFirstChild("Humanoid")
- if otherRootPart and otherHumanoid and otherHumanoid.Health > 0 then
- return otherRootPart
- end
- end
- end
- end
- return nil
- end
- while true do
- local target = findTargetRootPart()
- if target then
- humanoid:MoveTo(target.Position)
- end
- task.wait(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment