Code :
local datastore = game:GetService("DataStoreService"):GetDataStore("Time") game.Players.PlayerAdded:Connect(function(player) local s = Instance.new("Folder", player) s.Name = "leaderstats" local a = Instance.new("IntValue", s) a.Name = "Age" a.Value = player.AccountAge local b = Instance.new("IntValue", s) b.Name = "Time" local c = Instance.new("StringValue",s) c.Name = "FPS" local timee local s,e = pcall(function() timee= datastore:GetAsync(player.UserId) end) if s then b.Value = timee end game.Players.PlayerRemoving:Connect(function(plr) local timeee = plr.leaderstats.Time.Value local s,e = pcall(function() datastore:SetAsync(plr.UserId,timeee) end) if s then print("Time", timeee) else print("Error : ", e) end end) end)
When I rejoin the time resets back to zero instead of what I had last time.