Help for making an Customized AI

Hey, u probably have already seen me in this forums lol, so
Basically, i want to make a system for my rake game and im looking forwards to make an advanced AI,

How is the AI i want to achieve
So the ai is like, the rake follows random players of the map, when he finds a player (so like he is a distance of 75 studs of a player) he rages and becomes faster then attack the player with different animations from when he is walking and running
If the player go away he stops and if he kills the player he stops
And after that he will go back to follow the closest player

So how would i make this work?

Check roblox zombie model, does the same job.

You can use Humanoid:MoveTo() to move an NPC in a specific direction, so long as the model itself contains a Humanoid. For them to find players across the map, you can make use of PathfindingService and perhaps Raycast to determine if the player is in the direct line of sight to make use of mere Humanoid:MoveTo() instead of computing new paths per loop (which due to client-server sync will hinder your NPC from reaching them.)
As for checking the nearest player, you can make use of Player:DistanceFromCharacter() or magnitude. Once that magnitude is low enough, you can set the NPC’s walkspeed as you wish.

1 Like

Oh didnt knew about that Player:DistanceFromCharacter feature thank ya it helped me a lot

1 Like