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

How do I put a player name on a textLabel? [Solved]

I was trying to make a billboardgui that will say the players name. Everything went fine until I started to put the players name on the textLabel. Every time I tried something it would not work.

I don't know if i'm being dumb and the problem is right in my face, but I can't seem to figure out why it does not work.

(This is the code.)

game.Players.PlayerAdded:Connect(function(Plr)
	Plr.CharacterAdded:Connect(function(Char)
		plrNameUI:Clone().Parent = Char.Head
		plrNameUI.plrName.Text = Plr.Name
	end)
end)

(And This is the line i'm talking about.)

plrNameUI.plrName.Text = Plr.Name

I tried printing out the name and it worked perfectly fine. I also tried while in game to change it. it worked fine. I tried my hardest to find what the problem is, but can't. I hope I explained everything.

1 answer

I have found why it does not work.

The reason why is because the whole time I was changing the text in ServerStorage. Not The Players Head. Well their we go. I have fixed it my own. (sorry for making a post that was so easy why it was not working.)

2 comments

0

oh i forgot. here is what i did to fix it. "Char.Head.plrNameUI.plrName.Text = Plr.Name"

0

oh lol

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