I am trying to make the TextLabel's text to change depending on how much gold I have. I don't know if I am doing anything wrong. There is no output. I am fairly new to scripting so i'm sorry if the mistake is rather obvious. This is located in server script storage.
Thanks.
local player = game.Players.LocalPlayer--Finds the player
local gui = player:WaitForChild("PlayerGui").GoldHolder--Finds the gui
local gold = player:WaitForChild("leaderstats").Gold--Finds the gold in the leaderstats
local button = gui.TextLabel--Finds the label
game.Players.PlayerAdded:connect(function()
print("Hello")--Doesn't print
button.Text = "Gold "..gold.Value
end)

1 comment
Little tip. You don't need to use a player added event in a local script. This LocalScript will get replicated to the player meaning... Well... Meaning a player added event is never needed in a local script. This might even be your problem, I'm not sure. Try removing lines 6 and 9.