Hey there!
I am working on a season pass system, and I hit a wall with trying to save the data. The way the script works is it gets how many tokens the player has, and sees how many will the add up to the next tier. Example: Tier 1 = 5 tokens, Tier 2 = 15 etc.
The script then adds up how many of the tiers the player has completed. Now there are premium and basic rewards for each tier. When players want to claim their rewards I have to check if they have already claimed it.
I already have to code to check if they have completed the tier, but when trying to save which items have already been claimed, unless I make a table if 40 bools and save that for both premium and basic, it does not seem very efficient to me.
My original thought was to just save the number of times to for claimed items, for example
if numberOfSlots - player:WaitForChild("NumberOfBasicClaims").Value > 0 then
player:WaitForChild("NumberOfBasicClaims").Value += 1
return true
end
But then this raises the issue, what happens if someone had a tier level of 5, with no claimed items, someone accidentally clicked claim twice for one item, leaving 3 more claim clicks, there would then always be one item that was never claimed. After claiming the other 3 items the player would try to claim the last one but couldn’t because the numberOfBasicClaims already = 5, which means that the count would be = 0. Thus the item can’t be claimed.
I know this is a lot but I am really unsure where to go with this.
I can provide the actually code for everything if needed!
Thanks!