p.s: I’m bad when it comes to programming terms, but I’m pretty sure this is a dictionary because it has the key and then the value or whatever.
So I have a module script for player data and I have this table which will hold stuff the player owns the number will be the amount of it however when working on my shop script I couldn’t seem to figure out how to change the number.
Upgrades = {
["Stools"] = 4,
["Tables"] = 6,
}
I thought doing playerData:GetData(player,"Upgrades")[itemToBuy.Name] + 1 would work however I guess it doesn’t update so if I was trying to increase stools it’s always just gonna end up being 5 lol. Anyways not sure how to change the number.
Yes. You need to actually set the datastore, when you get data you’re copying the table, you aren’t editing a direct reference to the datastore. I would use a :SetData() method to completely overwrite something like that. Then, for numerical values, make an :Increment(amount) value.