players.PlayerRemoving:Connect(function(plr)
local success, errormessage = pcall(function()
playerData:SetAsync(plr.UserId.."-rep", plr.leaderstats.Reputation.Value)
end)
if success then
print(plr.Name.. " successfully saved.")
else
print("There was an error saving "..plr.Name.."'s".." data.")
warn(errormessage)
end
end)
Problem
I've been doing some research on data saving and watched some tutorials. This block of code seems to work, but only inGame; not on studio. I made sure to have API services on for studio so that's not the issue. I've seen it run ONCE in studio and never again since. Is it because it's unable to get the data before I exit test mode?
I do plan on having other saving methods, but I'd think having a final last save on leave would be a good idea too if possible.
Question
Why doesn't data save on leave ONLY in studio? Should it be of any concern since it works inGame as intended?
