I'm making a pathfinding script where an NPC follows a player, but I don't know how to define the humanoid. I'd appreciate it if someone could give me 1 or 2 ways on how to make a variable for a humanoid.
Edit: Just wanna clarify: I wanna make a variable for the humanoid that the NPC follows, and I'd like to make the NPC just follow the nearest player but can also switch targets like in ROBLOX RPG games.