-
What do you want to achieve?
After the NPC completes this:
while true do
wait (5)
char = script.Parent
pathFinder = game:GetService("PathfindingService")
path = pathFinder:CreatePath()
path:ComputeAsync(char.HumanoidRootPart.Position,workspace.guipart.Position)
for i, wayPoint in pairs(path:GetWaypoints()) do
char.Humanoid:MoveTo(wayPoint.Position)
if wayPoint.Action == Enum.PathWaypointAction.Jump then
char.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
char.Humanoid.MoveToFinished:wait()
end
wait(20) ---how much time inbetween movements
char = script.Parent
pathFinder = game:GetService("PathfindingService")
path = pathFinder:CreatePath()
path:ComputeAsync(char.HumanoidRootPart.Position, workspace.Dest.Position)
for i, wayPoint in pairs(path:GetWaypoints()) do
char.Humanoid:MoveTo(wayPoint.Position)
if wayPoint.Action == Enum.PathWaypointAction.Jump then
char.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
char.Humanoid.MoveToFinished:wait()
end
wait (40)
end
I’d like the NPC to wander for a certain amount of time before repeating the script.
-
What is the issue?
Not sure how to achieve what I’d like to and was hoping the knowledgeable individuals on the forum could help! -
What solutions have you tried so far?
I’ve tried adding a wandering script from a Wandering NPC model into the script I’ve written but it didn’t workNot a lot of information on the DevForum either
Thank you!