28Y8
(onses)
February 9, 2020, 11:50pm
#1
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
CapnFry
(CapnFry)
February 9, 2020, 11:55pm
#2
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
}
28Y8
(onses)
February 10, 2020, 12:01am
#3
So the way I’ve already done it, is alright?
CapnFry
(CapnFry)
February 10, 2020, 12:04am
#4
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
nooneisback
(nooneisback)
February 10, 2020, 12:24am
#5
Ignoring the fact that the Default and Shop tables can be combined into one, there is nothing wrong with this.