RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"npc not moving to waypoint pls fix"
It seems like the NPC is not moving because the `walkTo()` function is not being called correctly in the `patrol()` function. Here's how you can fix it: ```lua local function patrol() local waypoints = workspace.Zombie.Waypoints:GetChildren() local randomNum = math.random(1, #waypoints) local destination = waypoints[randomNum] walkTo(destination) end ``` In the above script, we are passing the destination waypoint to the `walkTo()` function. Make sure that the `workspace.Zombie.Waypoints` path correctly leads to the waypoints in your game workspace. Also, ensure that your waypoints are `BasePart` instances (like a Part or a Model's PrimaryPart), as the `walkTo()` function is expecting a `BasePart` as the destination. If your waypoints are not `BasePart` instances, you will need to adjust your script to get the `BasePart` from each waypoint. If the NPC is still not moving, try debugging by adding print statements in your script to check if the waypoints are being correctly accessed and the `walkTo()` function is being called.