Hello, im working on a script that moves the npc to different parts (named pos1, pos2..on and on) And the method im using for this looks really ugly and not efficient. So can anyone recommend some better ways of doing this?
Freddy = game.Workspace.NPCs.Freddy.Humanoid fred1 = game.Workspace.FreddyPositions.pos1.Position fred2 = game.Workspace.FreddyPositions.pos2.Position fred3 = game.Workspace.FreddyPositions.pos3.Position fred4 = game.Workspace.FreddyPositions.pos4.Position fred5 = game.Workspace.FreddyPositions.pos5.Position fred6 = game.Workspace.FreddyPositions.pos6.Position fred7 = game.Workspace.FreddyPositions.pos7.Position fred8 = game.Workspace.FreddyPositions.pos8.Position Freddy:MoveTo(fred1) Freddy.MoveToFinished:wait() Freddy:MoveTo(fred2) -- on and on and on
Thank you for the help! By the way, fred1, 2, etc. Are all different parts placed around that he moves to. The way im doing this already works, but I need to know if theres a better way since I am going to have alot more than just 8 positions.