How to make a datastore shop?

Hello dear devforum users,

I tried all I could do for scripting a datastore shop, I’ve seen in simulators datastore shops for example: I join in a simulator and I see a button named Buy I press it then it shows the text owned and I leave the game, when I rejoin it says owned. I name it “DataStoreShop” each help is apprieciated!

Thank you!

5 Likes

Can someone help me? or this question is not answerable?

You could make a module that returns a table of the stuff that are available to buy and change its value to owned when the player purchases it then save said data.

You can require this whilst loading data use a remote function that returns the table to the client to update the changes, There might be a better method but I just made this up on the spot.

ex:

module.tools = {
    -- ["Tool Name"] = {Owned = false/true}
    ["Sword"] = {Owned = false }, 
}

there isn’t a trick, the process of saving data is the same, save what you need to save when the player leaves and when he joins back you check his data

Saving the table when the player purchases might be a better idea to avoid possible data loss but it has its cons.

I heard that UpdateAsync can change Booleans.

tools from screengui… i need a data shop…

I don’t think I can use datastores in modules

there are data manager modules to manage player data which makes your life easier.

I wanna save the textbutton text so it says owned after purchase

??? so you want to save the TextButton text?

yes, I do. why not??? so? is it possible?

Of course it is possible, but honestly you may have a really crazy idea for a shop :joy:

this should be your answer: GlobalDataStore:UpdateAsync (roblox.com)

I have a personal question on you.

Do you mind if I ask the question?

Do not ask to ask just ask the question, I can’t just reply “yes”

I just ask then, Can we do a game together?

If you want tho, because two scripters are more better as one…

This is getting really off topic, unfortunately I can’t, I have my own plans and goals y’know.

Okay! thank you for your help!

1 Like