Help me with AI

I’m creating an fps. I have a shooting script and every thing I just want my AI to be-able to wander around the worldspace without bumping into any thing (I only need the part of the script that makes it wander around). I’m looking for a raycast kind of AI but I don’t know how to write a raycast script

These two links have everithing that you need: