#profilestore data editing help
1 messages · Page 1 of 1 (latest)
** You are now Level 12! **
You don't.
what you instead do is write migration code that updates a player's savedata to latest version and validates/verifies their data, renaming things as needed.
basically, you need to think about this from the opposite direction. you can't just "change all existing player savedata" that's not practical. you instead "change"/verify/update/etc the player savedata when they join.
and part of that can be a renaming rule
bear in mind you probably won't be able to ever use the original name for anything ever again without getting collisions, so if you want to be able to use the original name you'll need to make it version sensitive, i.e only rename if the savedata is older than a certain date
good luck 
this makes sense i figured this is what id have to do but didnt know if there was another way
i looked thru documentation and couldnt find naything
this makes sense thank you very much
there is no other way. version migration is the only viable technique.
which means somewhere in your code, somehow, always, every little mistake you've ever made when building out the profile data will be recorded somewhere, forever. 🙂

add Version = 1 smth like that
if the current version is greater than the datastore said version, update with the version table
local currentVersion = game.ServerStorage.DataStoreVersion.Value
local versions = {
[1.1] = function(data)
data.Coins = 0 -- resets coins
return data
end
}
i will do that
thank you