Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make a Humanoid go to another humanoid that is not a player?

Asked by 9 years ago

How do you make a Humanoid (or an enemy) go to another humanoid that is not a player (a robloxian)?

1 answer

Log in to vote
2
Answered by 9 years ago

You could use something called WalkToPart or WalkToPoint. WalkToPart is an object value so make the WalkToPart the enemy's torso or something like this:

game.Workspace.Player1.Humanoid.WalkToPart = game.Workspace.Enemy.Torso

The character will walk to the enemy.


This would also work. This uses WalkToPoint which is a Vector3 value.

game.Workspace.Player1.Humanoid.WalkToPoint = game.Workspace.Enemy.Torso.Position

I hoped this helped! Below is some EXTRA STUFF YOU MIGHT WANT TO KNOW!


With this feature has some drawbacks. If it's a player then they can just WALKAWAY! What you might want to do is make a loop that loops until the humanoid has reached it's destination.

while wait() do
    game.Workspace.Player1.Humanoid.WalkToPoint = game.Workspace.Enemy.Torso.Position
end
--or
while wait() do
    game.Workspace.Player1.Humanoid.WalkToPoint = game.Workspace.Enemy.Torso.Position
end

Note this will make the player go on forever and when the enemy dies or dissapears, then the script will error so work this out.

Ad

Answer this question