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.
The script is good, but you cannot set an IntValue to a String, you need to convert it first using tostring()
coinsvalue = script.Parent game.Players.PlayerAdded:Connect(function(player) while true do coinsvalue.Text = tostring(player.leaderstats.Coins.Value) wait(0.5) end end)
This may work, make sure you have a leaderstats.
coinsvalue = script.Parent game.Players.PlayerAdded:Connect(function(player) while wait() do coinsvalue.Text = player.leaderstats.Coins.Value end end)