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

Why wont this script work?

I made a script for a NPC with a humanoid property to move them from place to place but when I use it on a Model without a humanoid property it doesn't work

Script is here for the humanoid NPC

local part = game.Workspace.Node1
local node = game.Workspace.Node2

while true do
script.Parent.Humanoid:MoveTo(Vector3.new(-13, 0.59, 31) )
wait(5)
script.Parent.Humanoid:MoveTo(Vector3.new(-13, 0.59, 93) )
wait(3)
script.Parent.Humanoid:MoveTo(Vector3.new(-7.2, 0.59, 93) )
wait(1)
script.Parent:remove()
end


script for Model without humanoid

local Van = Script.Parent

while true do
script.Parent:MoveTo(Vector3.new(47.2, 0.19, 43) )
wait(5)
script.Parent:MoveTo(Vector3.new(-5.6, 0.19, 43) )
wait(3)
script.Parent:MoveTo(Vector3.new(-32, 0.19, 43) )
wait(1)
script.Parent:MoveTo(Vector3.new(-89.4, 0.19, 43) )
wait(5)
script.Parent:MoveTo(Vector3.new(-105.4, 0.19, 43) )
wait(1)
script.Parent:remove()
end


2 answers

MoveTo as a property of Humanoid will attempt to make the Humanoid's character model walk to the provided location.

MoveTo as a property of Model will teleport the model to the provided location, similar to CFrame.

Well if you don't use Humanoid, your going to Teleport the whole model to the actual Coordinates in your Vector3new() , also if you use the Humanoid in MoveTo() it will make the Humanoid walk to the location.

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