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

Why wont this script work?

Asked by
Prioxis 673 Moderation Voter
9 years ago

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

Log in to vote
2
Answered by
MrFlimsy 345 Moderation Voter
9 years ago

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.

Ad
Log in to vote
2
Answered by
HexC3D 830 Moderation Voter
9 years ago

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.

Answer this question