Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to Call LocalPlayer.Name on serverscript?

i tested

print(game.Players.LocalPlayer.Name)

BUT I DONT WANT USE game.Players.PlayerAdded help me

2 comments

0

And im using server script on gui (I NEED SERVER SCRIPT ON GUI)

0

LocalPlayer isn't a thing on the server... You'll have to use PlayerAdded

1 answer

✓ Accepted answer

If you have the script in the gui then the screen gui is child of playerGui which is child of player so all you have to do is type script.Parent.Parent... -- to get to the player.

2 comments

0

Thanks :)

0

Having Scripts inside of the StarterGui is terribly bad practice, instead just convert it to a LocalScript and use LocalPlayer.

This discussion is preserved as it was. New answers, comments, and votes are closed.