How would I go about making a simulator-type shop?

So I’ve been trying to make a shop where you have to buy the first item before you can buy the second item, then you have to buy the second item to buy the third item, etcetera. How would you go about this most efficiently?

What aspects of DataStoreService should I use to save a players progress, and how would I go about scripting it.

Just really a bit stuck here not sure how the overall system should work, maybe using module scripts somehow?

Edit: If this question has already been answered in another post please reply to me with the link.

You could do something where it saves the Player’s items to a StringValue. This way both your Data can be saved easily and you can check what items the player has and if they’re allowed to buy the next item.

1 Like

I would save the item tier number in the datastore.

For example, if the player didn’t buy the first item yet, you would set it to 0, if the player has the first item but doesn’t have the second item, you would set it to 1, and so on.

This is what I would do but you if you find a better way, you can do it like that.

1 Like

I don’t get it, so set a string value to all the items you have like:

local itemsString = "wooden dagger, stone dagger, iron dagger"

I meant like an individual string value for all the items. Maybe a rank with a NumberValue attached to that?

AlvinBlox has actually released a good tutorial on just this awhile ago on youtube here

I don’t remember if his has a method of tracking whether or not you’ve bought the previous item in the shop, but that could be done by storing every item in a table with a number value in order of 1,2,3,etc, then for example if you’re attempting to buy 2 the script would check whether or not 1 has already been purchased.

1 Like