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

How do i makemy leaderstats Gui go down?

Im trying to make a GUI that Displays your current Money value Based on the Leader stats, it works fine for going up, But when i Purchase something (Take away money) The leader stats goes down but not the GUI,

Here's my script

local Money = script.Parent.Parent.Parent.Parent.Parent.leaderstats.Money


Money.changed:connect(function()
	script.Parent.Text = "$"..Money.Value
end)

Any help would be great Thank you!

2 comments

0

Sorry for the Typo in the title

0

Money.changed should be Money.Changed, also, :connect is deprecated, try using :Connect instead. Not sure if this is the problem, but it could be.

1 answer

✓ Accepted answer

You should use LocalPlayer when trying to fetch leaderstats. Try this:

local Money = game.Players.LocalPlayer.leaderstats.Money

Money.Changed:Connect(function()
    script.Parent.Text = "$"..Money.Value
end)

Please accept this answer if this helps!

1 comment

0

Thank you

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