Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited by Ziffixture 4 years ago

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

Log in to vote
0
Answered by 4 years ago

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.)

0
oh i forgot. here is what i did to fix it. "Char.Head.plrNameUI.plrName.Text = Plr.Name" DevDukee 0 — 4y
0
oh lol Oblivious_Blitz 1 — 4y
Ad

Answer this question