this is not a request, i just need some guidance because i am really lost on this
how do i find the local player using a script, not a local script?
1 answer
Is there an equivalent to game.Players.LocalPlayer, but in a server script?
Nope.
Local scripts can only do this because they're running on individual computers. Server scripts aren't, so they don't have this feature.
What you specifically need to do depends on your situation.
If you have a way of getting someone's character, you can use
GetPlayerFromCharacter. This is often used in touched events.MouseClick events actually give you the player who clicked as a parameter.
But it really depends on the situation.
Another possible situation you're in is that you are using a server script (or want to use one) when you should be using a local script. Here are some situations that you should always use a local script:
GUIs. They're on individual screens, and individual people interact with them. Moreover, they're parented to the PlayerGui, which is inside a specific player.
Tools. Again, they receive input from individual people and are parented to individual players.
Although local scripts are used for a myriad of purposes, these are the ones most often confused. But if you find that you just desperately need to use a server script, use remote events or functions.
3 comments
yea i tried all of this and it didnt work, would i have to work with the StarterPlayerScripts and StarterCharacterScripts
You should use local scripts if you want to use StarterPlayerScripts or StarterCharacterScripts.
i found another way for getting a player using a script,put a script in screen gui and just put a bunch of parents until you find the player
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
(I'm posting the comment here so you'll get the notification) DO NOT do that. As I said in the answer, GUIs are local. Therefore you should use local scripts when working with them. Server scripts should only be inside workspace or ServerScriptService.
im trying to make a gui so it shows the players level, when i used a local script, it worked but only i could have seen it, it would have showed up as label on another players screen