Can Someone Help me with this
The ID is the value and i want to save this but it also changes after a while and i also wanna save that so that i have both of them saved
local function saveData(player, ID, Name) -- The functions that saves data
local tableToSave = {
}
local success, err = pcall(function()
dataStore:SetAsync("Vids", tableToSave) -- Save the data with the player UserId, and the table we wanna save
end)
if success then -- If the data has been saved
print("Data has been saved!")
else -- Else if the save failed
print("Data hasn't been saved!")
warn(err)
end
end
Why not save it to a table without the player name?
Or for example, if you want everyone to be upgraded to ‘level 2’ because ‘PlayerX’ got them there then save 2 tables, one for the level (data) and one for the player name.
So save that value to the player’s data, whether just in game, or to dataStores.
If their value changes then first save it, then update the script that needs the value.
When your script reads the values saved to each player, compare them and use the highest value of all of them.