His name is Tim and he is a model.
while true do
pos = game.Workspace.Part.Position
game.Workspace.Tim.Humanoid:MoveTo(pos)
wait(1)
end
His name is Tim and he is a model.
while true do
pos = game.Workspace.Part.Position
game.Workspace.Tim.Humanoid:MoveTo(pos)
wait(1)
end
You forgot the local. When you put a variable and don't put local in front of it the game searches for a keyword that matches the word and if there isn't one, It does nothing.
while true do
local pos = game.Workspace.Part.Position
local Tim = game.Workspace.Tim
Tim.Humanoid:MoveTo(pos)
wait(1)
end
****If this answered your Question please press accept answer. :D
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
The original code is not wrong since I successfully tested on Toolbox's NPC, but the NPC that I made can't move for some reason.
-1. Variables without the local keyword are global variables, not "keywords". Although they should be avoided, global variables can still be used to perform calculations. Plus, that does not solve the problem.
-1. General agreement with Link150