[SOLVED] Is there a way to get player from normal script?

im trying to do a AI script, but i need to get the player. But the doubt is: i cant get player without use a local script, and if i use a local script, the script brokens.

Thanks for Reading and Helping, TinkyWinkyDev

You really can’t get a normal player from a standard script. However, there are events that detect players, such as PlayerAdded, or Prompt.Triggered, both parameters have the specific player.

3 Likes

Hmmm, thanks for telling me that.

2 Likes

From the server’s perspective, there isn’t “the player”, unless of course there’s only one player in the game.
Very generally, a player (client-side) will Fire a RemoteEvent to the server indicating some particular
action by a particular player.
You can get the current players this way:
local plyrsTbl = game.Players:GetPlayers()
See:

6 Likes

Thanks for Helping me, i’ll readapt my script now.

You’re welcome–Armed with those new search terms, you’ll find plenty of related discussions here.

1 Like