#Make Npc walking random for a part

1 messages · Page 1 of 1 (latest)

faint escarp
#

My Goal make a game like dingus or npc or die.
But First i need understand how to work pathFind.
I have watching a vidéo and copy the script but for a wierd reason that dont work so here the script:
*local pfs = game:GetService("PathfindingService")
local char = script.Parent
local hum = char.Humanoid

local possibleDestination = game.Workspace.pos:GetChildren()

wait(3)

while true do
local destination = possibleDestination[math.random(1, #possibleDestination)]
local path = pfs:CreatePath()
path:ComputeAsync(char.HumanoidRootPart.Position, destination.Position)

for i, waypoint in pairs(path:GetWaypoints()) do
    hum:MoveTo(waypoint.Position)
    hum.MoveToFinished:Wait()
end

end*

#

And Sorry for my Grammar English not my Native Language

faint escarp
#

Bump