Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

NPC stays in place for some reason?!

game.ServerStorage.THEBoss.Parent = workspace
local animation = workspace.THEBoss.Humanoid:LoadAnimation(workspace.THEBoss.Animation)
animation:Play()
local h = workspace.THEBoss.Humanoid
h:MoveTo(Vector3.new(1385.572, 102.5, -120.196))
wait(5)
h:MoveTo(Vector3.new(1450.192, 102.5, -194.746))
wait(5)

What Works The boss goes to workspace, and animation plays. What doesnt work He doesn't move at all. This is my problem

1 comment

0

If anybody needs me to elaborate, i'll be glad to.

2 answers

Make sure the model isn't anchored

2 comments

0

If it's anchored, i cant animate it.

0

Sometimes people (myself included) animate and then accidentally anchored everything. Maybe you accidentally did that; I can't find any errors in your script

I believe that you should add h:MoveToFinished:Wait(2), two seconds is usually enough for an AI to finish walking. So, this is how it is supposed to look like:

game.ServerStorage.THEBoss.Parent = workspace
local animation = workspace.THEBoss.Humanoid:LoadAnimation(workspace.THEBoss.Animation)
animation:Play()
local h = workspace.THEBoss.Humanoid
h:MoveTo(Vector3.new(1385.572, 102.5, -120.196))
h:MoveToFinished:Wait(2)
wait(5)
h:MoveTo(Vector3.new(1450.192, 102.5, -194.746))
h:MoveToFinished:Wait(2)
wait(5)

Also, check if the model is not anchored.

2 comments

0

Thanks i think it might work but now your OnTouch script isnt working now?

0

Hmm, it should.

This discussion is preserved as it was. New answers, comments, and votes are closed.