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

My money saves through console but not through a button, how do I fix?

Asked by
xf8d 5
3 years ago

So today I made a data saving script so I can, ya know, save data. Whenever I change the amount of cash I have in console to some number, let's say 50, it saves whenever I leave. However whenever I gain money through a button and then leave, it doesn't save. I have no clue why it does this, and in every tutorial I've seen this doesn't happen.

0
Button code local debounce = false script.Parent.MouseButton1Click:Connect(function() if debounce == false then game.Players.LocalPlayer.Character.Humanoid.Health = 0 game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value + 1 debounce = true wait(3) debounce = false end end) xf8d 5 — 3y

Answer this question