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

i need to make a npc/noob randomly wander around my map?

Asked by 4 years ago

i tryed to find how to do it i tryed lots but it just walks to the edge of the map

my code is this

while true do script.Parent.NPC:MoveTo(Vector3.new(math.random(-820, 840), 0, math.random(-820, 840)), game.Workspace.Terrain) for i= 1,10 do wait(0.5) script.Parent.Head.RakeStep:Play() end wait(5) end

with my map its not working can i have help???

0
game.Workspace.Terrain fulfills the 2nd parameter of MoveTo(), which sets the property of Humanoid.MoveToPart to the terrain in Workspace. The reason why it is moving to the edge is because the edge is the only reasonable location to walk upon the terrain to. If you leave said parameter nil and edit the X, Y and Z values in accordance with the terrain's main position, the script should work. DeceptiveCaster 3761 — 4y
0
Use region 3 and path finding MxoShine 7 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
while true do
script.Parent.NPC.Humanoid:MoveTo(Vector3.new(math.random(-820, 840), 0, math.random(-820, 840)))--Sorry you would have to manually enter the size of your terrain.
for i= 1,10 do wait(0.5) 
script.Parent.Head.RakeStep:Play() end 
wait(5)
 end

I don't know if this works or not

0
how do i know that oof jablesgamer1 2 — 4y
0
o and is that is studs? +i cant find the plate i used for it jablesgamer1 2 — 4y
0
should i make a new map or not? jablesgamer1 2 — 4y
0
I don't know. Its not my game. antoniorigo4 117 — 4y
Ad

Answer this question