1 | game.Players.PlayerAdded:Connect( function (plr) |
2 | wait( 1 ) |
3 | game.StarterGui.StarterGui.PlayerName.Text = game.Players.LocalPlayer.Character.Name |
4 | end ) |
I've tried so many different things to change it, but it never worked. I'm using a local script because I'm trying to make a loading screen GUI kind of.
Try puting this local script in your screengui:
1 | local player = game.Players.LocalPlayer --Using PlayerAdded is deprecated, user LocalPlayer instead. |
2 |
3 | player.PlayerGui. [ Your ScreenGui name ] .PlayerName.Text = player.Name |
You should try:
1 | game.Players.PlayerAdded:Connect( function (plr) |
2 | wait( 1 ) |
3 | game.StarterGui.StarterGui.PlayerName.Text = game.Players.LocalPlayer.Name |
4 | end ) |
Else you should add a waitforchild function at the startergui
Put the localscript inside the text
1 | local player = game.Players.LocalPlayer |
2 | local text = script.parent |
3 |
4 | text.text = player.name |