For some reason, one of the simplest things isn't working. I am trying to make a button that when you click it, it subtracts a currency found in a GUI (Not advanced enough to make leaderboard cash, if you can help with this please tell me how.) However, when I click the button it does nothing! Even crazier, the button updates nothing at all, if I press it, it won't even register it as a click. Here is my the code:
script.Parent.MouseButton1Down:Connect(function() game.StarterGui.Money.TextLabel.Number.Value = game.StarterGui.Money.TextLabel.Number.Value - 10 end)
You're modifying the StarterGui
. Changes in StarterGui
apply when the player respawns and the gui is next cloned to them. you want to modify Player.PlayerGui
instead, with something like game.Players.LocalPlayer.Money.TextLabel.Number.Value = "something"
(assuming this is a LocalScript
, like all gui scripts should be).