Create path_finding_npc.cs

This commit is contained in:
Elvis Tony 2024-05-29 10:25:31 +01:00 committed by GitHub
parent 019d713cf9
commit 125d8a9aa2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

8
path_finding_npc.cs Normal file
View file

@ -0,0 +1,8 @@
local waypoints = game.Workspace.Waypoints
local npc = script.Parent:WaitForChild("Humanoid")
while true do
for waypoint = 1, #waypoints:GetChildren() - 1 do
npc:MoveTo(waypoints[waypoint].Position)
npc.MoveToFinished:Wait()
end
end