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

My cash gui for my tycoon will not update to the user's current cash value. Can anyone help?

Asked by 4 years ago

Hi I am trying to make a cash gui for my tycoon and I can't seem to get it to work. Here is my code:

player = game.Players.LocalPlayer

function update() script.Parent.Text = player.leaderstats.Cash.Value end

player.leaderstats.Cash.Value.Changed:Connect(update)

When I claim the money, the cash gui does not change.

1 answer

Log in to vote
0
Answered by
haba_nero 386 Moderation Voter
4 years ago

Try this! Put this LOCALSCRIPT in a TEXTLABEL you want to state your cash

local Value = game.Players.LocalPlayer.leaderstats:FindFirstChild("YOURCASHNAME")
script.Parent.Text = Value.Value
Value.Changed:Connect(function()
    script.Parent.Text = Value.Value
end

Replace YOURCASHNAME with the cash name (money, coins, cash, etc) This probably works, have fun!

0
Thank you! Channy97 10 — 4y
0
Yw :) haba_nero 386 — 4y
1
Could you accept my answer? haba_nero 386 — 4y
0
accept his answer Prbo1201 56 — 4y
Ad

Answer this question