I’m not here to solve the problem, but give feedback on the system.
I’m not sure why you would at all want a system like this, I personally think it would be more frustrating than anything.
(Assuming these characters are purely cosmetic, but if they’re not, that adds a new question on why you’re locking stuff like this)
Here’s a scenario:
-
Player 1 has been playing the game for a few weeks and has racked up 510 kills.
Player 2 only started playing today, and only has 15 kills.
-
A new skin got added today, with a requirement of 550 kills.
-
Player 1 should expect to be able to purchase that new skin soon, as they already have 510 kills, however the system says they’re only at “5/550 kills”, causing Player 1 to assume that the game is bugged, or get extremely frustrated that they have to do all that grinding again.
-
Player 2 has no idea this mechanic exists. Every skin displays as having “15/x kills”.
-
Player 1 quits the game, never returns.
-
Player 2 keeps playing, and eventually the cycle repeats itself, with Player 2 now in this scenario, being Player 1.
Think of this system as resetting everyone’s progress in an RPG whenever a new area gets added.
Anyone who played prior to the update will be angry, meanwhile new players will just be confused to why everyone’s angry.
Alternatively, in a shooter scenario:
A new attachment gets released for the assault class, with a requirement of 500 kills. Players who already have 500 kills in that class do not own the attachment for some reason, only to figure out they have to get another 500 kills to unlock it.
Of course, bit of a stretch there with the RPG scenario, but point is, if someone already has the requirements to unlock something, they should just unlock it.
Extra grind is not fun, especially when you as the player feel you should already have the item.
Anyway, to answer your question, I do think that your thought out system would be one of the only way to do this, however a more optimal system would be to roll out skins in groups, and then save data for each group of “Characters” instead of for each skin separately.
Effectively, what you already have but instead of per character, its per group.
ShopData = {
["CharacterRollout1"] = 28,
["CharacterRollout2"] = 12,
["CharacterRollout3"] = 0,
}
--// searching character rollouts:
local folder = game.ReplicatedStorage.CharactersFolder
-- - CharacterRollout1: Folder
-- - - Character1: Model
-- - - Character2: Model
-- - CharacterRollout2: Folder
-- - - Character3: Model
-- - CharacterRollout3: Folder
-- - - Character4: Model
-- - - Character5: Model
for rollout, kills in ShopData do
for _, character in folder[rollout]:GetChildren() do
if character:GetAttribute("Kills") <= kills then
--// Character is purchasable.
else
--// Character is not purchasable.
end
end
end