How do I replace this text?

Hello!

Simple question, how do I get the text on the sign to say the players username that joined the game?
player name here...

Also in my time right now it is very late. I’ll respond tomorrow. Pretty sure!

Thanks.

You would need to use a LocalScript, that locally sets the name on the client. This means that each player will see his or her name.

Example:

--put this code in StarterPlayerScripts, or somewhere that LocalScript's will run.
player = game.Players.LocalPlayer
Text = Workspace.TextPart.SurfaceGui.TextLabel.Text -- I'm just guessing at the hierarchy of your TextLabel. Set this variable to the location of the Text of the TextLabel you want to manipulate.
Text = player.Name

Hope this helps!

1 Like

That should work just fine. You could also do script.Parent.Text = “Welcome, ”..game.Players.LocalPlayer.Name

Yee.

1 Like

The code doesn’t seem to be working.

The code doesn’t seem to be working…

This is because he’s trying to change a variable, not a property. You can’t assign a property as a variable and be able to set the property with it.

local player = game.Players.LocalPlayer
local label = workspace.part.SurfaceGui.TextLabel --path to label
label.Text = player.Name
1 Like

Thanks for your help! :grin: :grin: