How to make a shop gui that saves and one time purchase?

Hi there, I’ve been looking at some gear shop guis but I’m trying to find one where it saves the tool you bought and I have not found a single tutorial on Youtube that covers this, and it gets too hard for me to learn as I’m new to lua. I’ve already began looking at datastores however I don’t know how to properly put them in place inside a script. It would also be appreciated if you found some tutorial linking onto this thanks. Also quick note, the gear bought takes away cash in a numbervalue inside players

2 Likes

Why don’t you prompt a game pass purchase instead?

Because I’m basing this off a cash value

Gotcha.

Alright, so I assume you have a basic knowledge on storing data, tables and loops and whatnot.

So when the player purchases a product, create a new value inside of their data folder, wherever that may be.

Then when the player leaves, iterate through the folder and insert these values to a table, then set that table to the datastore.

2 Likes

If its a gamepass, you don’t even need datastores.
Just check if they own the gamepass and give the little craps what they want.

1 Like

Trouble understanding, is there a video or a post that explains this?