Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to get the value of a leaderstat?

Hi. How would I get the value of a leaderstat (Like the number 245 for example) to reside in a TextBox? (This leaderstat will be changing. How would I make the number on the GUI stay with the value of the leaderstat?

Thanks!

1 comment

0

You would use the Changed event in the script that deals with the text in your TextBox. http://wiki.roblox.com/index.php?title=API:Class/Instance/Changed

1 answer

Try doing this

local gui = script.Parent

gui.Text = ""..game.Players.LocalPlayer.leaderstats.Cash.Value

in Lua the .. Means to Include, Like for example You want to Add the Players name into a Welcome Gui then we would write it in this way:

script.Parent.Text = "Welcome "..game.Players.LocalPlayer.Name

You can also Do More than to just a Player's name, you can add Something that exists in Workspace or any other Containers.

Hope this helps.

This discussion is preserved as it was. New answers, comments, and votes are closed.