i tested
print(game.Players.LocalPlayer.Name)
BUT I DONT WANT USE game.Players.PlayerAdded help me
i tested
print(game.Players.LocalPlayer.Name)
BUT I DONT WANT USE game.Players.PlayerAdded help me
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.
Thanks :)
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.
2 comments
And im using server script on gui (I NEED SERVER SCRIPT ON GUI)
LocalPlayer isn't a thing on the server... You'll have to use PlayerAdded