To remove currency when a button is pressed, You have to
create a localscript, a remote event and a script
In the localscript, write:
1 | Button.MouseButton 1 Click:Connect( function () |
2 | game.ReplicatedStorage.RemoteEvent:FireServer( 500 ) |
in the script write:
1 | game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect( function (player, amount) |
2 | player.leaderstats [ 'Currency Name Here' ] - = amount |
If you were to remove the current on the client side, the currency would only get removed for the player. The other players and the server would not detect a change in the currency.