Yes, Since you need to listen to Path.WaypointReached event and call path:Run(target) to continue the waypoints, Instead I call a function to open the door and make the NPC move forward a bit when Waypoint Label is “Door” and do animation, After the animation I call Path:Run(target) again to continue
Use this to check repeatedly for the nearest player:
local function FindNearestPlayer()
while wait(0.5) do
local found
local last = math.huge
for _,plyr in pairs(game.Players:GetPlayers()) do
local distance = plyr:DistanceFromCharacter(script.Parent.HumanoidRootPart.Position)
if distance < last then
found = plyr
last = distance
end
end
Goal = found.Character.HumanoidRootPart
return Goal
end
end
I’ve since found the solution to the replied issue. For everyone who utilizes this module, please refer to this post, it may save you a headache in the future:
It was issue with my script, the model was supposed to have attributes for speeds, like RunSpeed and WalkSpeed, but I forgot to add them so speed was always 0, I’m just really dumb.
I got inspired by this module, and i used it on my first AI chaser for some testings.
and now ill tryna implement my own pathfinding module using this service, thx for sharing us your creation!
im having a bit of trouble with this.
when using this module on characters that are extremely large (nearly 230 studs tall), the module just doesnt work.
humanoid:moveto() works, but when i try to use path:run() the character just doesnt move.