Owned system, method?

Is it best to do an owned system like this? So let’s say the player purchases “Brick” from “Shop”, then the server sets it to True.

Is this a decent way of doing an “item owned/upgrade owned” system, or is there potentially a better method or structure to do this?

local function UpgradesData()
	return {
		Default = {
			Dirt = true
		},
		Shop = {
			Brick = false,
			Wood = false,
			Bronze = false,
			Alloy = false,
			Platinum = false,
			Titanium = false,
			Obsidian = false,
			Diamond = false,
			Rainbow = false
		},
		Equipped = {"Dirt"}
	}
end
1 Like

Here is an article I found on the developer forum to help with your question: Saving a folder full of stats through Datastore

I believe it would be smart to make a table of BoolValues to determine if the player has a shop item or not. And then save those boolvalues with a datastore. I would personally set it up like this:

Shop = {
    Brick = false,
    Wood = false,
    -- continuing
}

So the way I’ve already done it, is alright?

You could do your way I believe it would be a great way of making a table for BoolValues. Other developers might say otherwise, so listen for their say too.

1 Like

Ignoring the fact that the Default and Shop tables can be combined into one, there is nothing wrong with this.