How do you make enemy humanoids have good AI?

Recently i have been creating enemies with simple AI where they just walk up and attack the player.
How can i make them smarter?
Do they need to be smarter for a game to be fun?
Just short post because i just need some ideas on what to change about them.

All help is appreciated.

I hope you don’t mind me suggesting you try a search using
roblox npc ai and check out the results.

If you want you can take a look at neural networks.

Here is a module that might help