Hey, so I’m trying to make a script that will automatically save the same data from each gameslot a player has , and add the corresponding number to the key name. For example, if the player had 2 gameslots, it would save two character names, called GameSlot1CharacterName and GameSlot2CharacterName
I tried this, but the way I’ve defined them is incorrect as you can probably tell. How can I fix this?
local number = player.PlayerDataFolder.NumberOfLives.Value
wait()
repeat
local gameslotdatatobesaved = {
"GameSlot" .. number .. "CharacterName" = player.PlayerDataFolder:FindFirstChild("GameSlot" .. number .. "").CharacterName.Value
"GameSlot" .. number .. "SkinColor" = player.PlayerDataFolder:FindFirstChild("GameSlot" .. number .. "").SkinColor.Value
}
mystore:SetAsync(playerid,gameslotdatatobesaved)
wait()
number = number - 1
until
number == 0