Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you display a Leaderstat Value in a Gui?

Asked by 4 years ago
Edited 4 years ago

I'm making a Tycoon and I have made a leaderstat that is called 'Cash'. I'm trying to make a Gui that shows the amount of cash you have but I can't figure out how to do it. Please give a solution because everything I'm doing isn't working.

0
c Krystal_Kyle 47 — 4y
0
Try it again changed the script a bit Azure_Kite 885 — 4y
0
Thanks!!! Krystal_Kyle 47 — 4y
0
Can you mark my answer as answer? so i got some point and the post will be marked as "answered" Azure_Kite 885 — 4y
View all comments (5 more)
0
How do I do that? Krystal_Kyle 47 — 4y
0
Look around my answer there should be a button to mark it Azure_Kite 885 — 4y
0
It says I need 25 Reputation to upvote. Is that it? Krystal_Kyle 47 — 4y
0
ah nvm its fine Azure_Kite 885 — 4y
0
it should be "Accept answer" button at the bottom Azure_Kite 885 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Make a localscript inside the gui, and change the text to the value of 'Cash' everytime the value changes

example script :

local player = game.Players.LocalPlayer
local Cash = player:WaitForChild("leaderstats"):WaitForChild("Cash")

Cash.Changed:connect(function()
script.Parent.Text = Cash.Value
end)
0
It's still not working. Krystal_Kyle 47 — 4y
0
what is not working? any error in the output windows? saying "it doesnt work" doesnt help me help you Azure_Kite 885 — 4y
0
It is not displaying the value. I found this in the Ouput window. https://gyazo.com/99d8179fe7af6a92f7b7ce81d0e2847d Krystal_Kyle 47 — 4y
Ad

Answer this question