the loop is useless in here you can just put an event to check whenever the Value is Changed
here’s how to do it
local player = game.Players.LocalPlayer
local YourCurrency = player.leaderstats.Coins
local YourTextLabel = script.Parent
YourCurrency.Changed:Connect(function(val)
YourTextLabel.Text = val
end)
The suggestions above are basic and okay, however if you want / need abbreviations, you should make a function which abbreivates the number accordingly.
ok, I would suggest going with a Gui simular to this
heres what my script would look like
while wait(1) do
script.Parent.Text = '$ '..game.Players.LocalPlayer.leaderstats.Cash.Value -- Don't worry about what the text says just change 'Cash - ' to the name of your stat
end
if understand the .changed function you know that it only shows when the Cash value changes so when you first join nothing is being changed so it does not show on the label
local player = game.Players.LocalPlayer
local YourCurrency = player.leaderstats.Coins
local YourTextLabel = script.Parent
YourTextLabel.Text = YourCurrency.Value
YourCurrency.Changed:Connect(function(val)
YourTextLabel.Text = val
end)