We are making a model chase a player with pathfinding. We have the script, it’s just that we need to reference the player now. And I do not know how to do that.
I have researched on the developer hub and i have only found: local player = game.Players.localplayer
You can only do that with a local script and the script i am working on cannot work as a local script.
The server doesn’t and will not know that your model needs to chase a particular player. You need to make a system for finding players (as well as which player in particular) in the first place. Usually you can safely target the closest player to your model and use that player as your designated target.
I recommend looking into the Players service for finding players in your game. You can access it via game:GetService("Players"), as well as finding documentation here.
Also if you’re not familiar with the math, refer to using Vector3 and Magnitude between two vectors to get your distance between two points.