How do I set the text of a textlabel to a value within a player's leaderstats?
Asked by
5 years ago Edited 5 years ago
Hello,
So I am making a game called Mining Incorporated and i'm currently working on the gui's.
I have disabled the leaderboards but the leaderstats folder is still withing the player.
Now I have a textlabel to display the amount of coins you have and coins get added for every ore you sell.
I can not figure out how to do it, my script currently looks like this:
coinsvalue = script.Parent
game.Players.PlayerAdded:Connect(function(player)
while true do
coinsvalue.Text = player.leaderstats.Coins.Value
wait(0.5)
end
end)
So my question basically is: How do I set the text of a textlabel to the value of a leaderstat?
Sorry if my question is a bit unclear, I'm not english, Im 13 years old and i don't know how to word it.
Thanks for reading.