How do i make a shop gui that saves your purchases

Hi how do I make a shop gui that saves your purchases that can be re-equiped or be swapped between shop items (shop and inventory combined)
ex: like guns

and can be viewed in a inventory ui

im trying to make something similar to a wave defence

any help will be appreciated
thanks!

Can you be a little bit more specific in the “saves your purchase” part please?

You need to save data about player in his stats, and when he loads into the game you need to load his stats from DataStore
Then you need to check in inventory script if your player have this item in stats and thats all!

1 Like

like shop items that can be re-equiped / be swapped between shop items

So like an inventory and shop combined?

They both need to have access to player stats to check if he already has certain item

yes an inventory and shop combined

Alright well based on my understanding i think you need to assign a bool value to each one, whether with tables or instances, and if it’s true that means it’s bought and can be equipped.

Sorry if this was some confusing wording

oh ok .
i should try to find some tutorials on yt
but thanks for the reply!

1 Like

If you need an example to get started you can do something like this (just remember i’m not an expert at GUI’s so i can’t tell you what to put for display values):

inventory = {}
for y = 1, 5 do
    for x = 1, 5 do
        slot = {
        x =, --anything here like 20 or something i'm not sure
        y =, --same thing,
        price = 20,
        bought = false}
        table.insert(slot,inventory)
    end
end

How you chose to get the values is up to you.

ok thanks for the script i will try to get it working in the game