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

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

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

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!

4 comments

0

Thank you!

0

Yw :)

1

Could you accept my answer?

0

accept his answer

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