I need help with purchasing system!

Can someon please help me make a script when a gui button is clicked and you have enough currency it will dissapear. and with datastore it must also save after player leaves! Thanks!

just find a datastore script and use a remote function. a remote function returns things saved from the server onto the client. whenever they press the button fire the remote function, get their money. and if their money is over enough or enough subtract that amount of money from their save.

When the gui button is clicked, you want to fire a remote function (object that allows communication between server and client) to check if the player has enough money and if they do subtract money and give them the item by returning its name. You have to do all the checks on the client to prevent exploiters from messing up everything and accessing the real value of money. Then simply make a generic data store system to save the money

PS

If you want people to make you a purchase system consider posting a job on the talent hub