RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"for some reason the AI doesnt walk or anything at all please fix"
The AI might not be walking due to several reasons. Here are some potential issues and fixes: 1. Check if the humanoid is properly referenced. Make sure the Zombie character has a humanoid and it's properly referenced in the script. 2. The waypoints might not be properly set. Make sure the waypoints are in the correct position and they are accessible by the AI. 3. The path might not be successfully computed. Add a check to see if the path is successfully computed. If it's not, you might need to adjust the path parameters or the position of the waypoints. 4. The AI might be stuck in the attack state. If the target is always within the attack range, the AI might be stuck in the attack state and not move. You can add a check to see if the AI is in the attack state and if it is, stop the attack and move to the next waypoint. Here's a modified version of your script with added checks: ```lua while wait(0.25) do local target = findTarget() if target and target.Humanoid.Health > 0 then print("PLAYER FOUND", target.Name) humanoid.WalkSpeed = 15 attack(target) else patrol() end end function patrol() local waypoints = game.Workspace.Zombie.WP:GetChildren() local randomNum = math.random(1, #waypoints) local path = getPath(waypoints[randomNum]) if path.Status == Enum.PathStatus.Success then walkTo(waypoints[randomNum]) else print("Failed to compute path") end end ``` In this version, the script will first check if there's a target. If there is, it will attack the target. If not, it will patrol. The patrol function will also check if the path is successfully computed before moving to the waypoint. If the path is not successfully computed, it will print a message to the output.