I have a simple GUI with a button, which is supposed to increase a "cash" leaderstat by 5
cash = game.Players.LocalPlayer.leaderstats.Cash
script.Parent.MouseButton1Click:Connect(function()
cash.Value = cash.Value + 5
end)
The script is not local.
However when run it doesn't change the value. Not really sure what to do when it comes to these sorts of errors, any suggestions?

5 comments
You say the script is not Local. You can only use "LocalPlayer" in a LocalScript so that line doesn't work. And I don't know if only LocalScripts work in GUIs but I highly recommend it. So you have to change it to a LocalScript. But if you want the stats to change then it has to be a ServerScript that does it.
I can't answer right now, I can answer in like an hour, but I believe someone else will do it before then. But I do have an answer for your problem
What the person above says is correct, you would have to use a local script and then fire a remote event to a server script, which is where you will have to change the value.
If you really want to use a Script instead of a LocalScript, you could as well do "Player = script.Parent.Parent.." until you reach the player. That's how I sometimes do it.
Do not use scripts on the client. Look over this article to understand how the client-server model connects https://developer.roblox.com/en-us/articles/Roblox-Client-Server-Model