Now, i'm unsure if this is happening to players playing the game, but it has been happening for me and the game owner.
I have a datastore scirpt which loads the player's data when joining and saves it when leaving the game. However whenever I rejoin, most of the time my stage would be completely random.
local DS = game:GetService("DataStoreService"):GetDataStore("SomeDataButItsNotTheActualName") game.Players.PlayerAdded:connect(function(plr) local leaderstats = Instance.new("Model") leaderstats.Name = "leaderstats" leaderstats.Parent = plr local stage = Instance.new("NumberValue") stage.Name = "Stage" stage.Parent = leaderstats local cash = Instance.new("NumberValue") cash.Name = "Cash" cash.Parent = leaderstats local success, st = pcall(function() return DS:GetAsync("plr_" .. tostring(plr.UserId)) end) if success then stage.Value = st else game:GetService("ReplicatedStorage").Notify:FireClient(plr) end plr:LoadCharacter() game.Players.PlayerRemoving:connect(function(plr) local success, fail = pcall(function() DS:SetAsync("plr_" .. tostring(plr.UserId), stage.Value) end) if not success then local c = 0 while c < 4 do wait(5) local good, fail = pcall(function() DS:SetAsync("plr_" .. tostring(plr.UserId), stage.Value) end) if good then break end c = c + 1 end end end) end)
(snipped out irrelevant parts of the script)
So, what am I doing wrong?