I'm trying to get the player's name on to a textlabel when they first spawn in.
local player = game.Players.LocalPlayer local plrGui = player.PlayerGui.HealthGui.HealthHud.BorderForHealth.TextLabel function PlayerNameGoToHealthbar() plrGui.Text = player.Name end script.Parent.PlayerAdded:connect(PlayerNameGoToHealthbar)
This does nothing...Please help?
This works for me
local player = game.Players.LocalPlayer local plrGui = player.PlayerGui.HealthGui.HealthHud.BorderForHealth.TextLabel wait(1) plrGui.Text = player.Name
I've done these types of TextLabels without the PlayerAdded event before, it seems like that's would you would do but in reality, it's this simple:
local player = game.Players.LocalPlayer local plrGui = player.PlayerGui.HealthGui.HealthHud.BorderForHealth:WaitForChild("TextLabel") plrGUI.Text = plr.Name
Also, make sure you WaitForChild for the TextLabel, and make sure the script itself is a LocalScript!