Hey Guys my Gems and rebirths are not saving but my clicks do can anyone help me ?
``local dataStoreService = game:GetService("DataStoreService") local clicksDataStore = dataStoreService:GetDataStore("Clicks1") local rebirthsDataStore = dataStoreService:GetDataStore("Rebirths") local gemsDataStore = dataStoreService:GetDataStore("Gems") game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder",player) leaderstats.Name = "leaderstats" local clicks = Instance.new("IntValue",leaderstats) clicks.Name = "Clicks" clicks.Value = 0 local rebirths = Instance.new("IntValue",leaderstats) rebirths.Name = "Rebirths" rebirths.Value = 0 local gems = Instance.new("IntValue",leaderstats) gems.Name = "Gems" gems.Value = 0 local playerUserId = "player_" ..player.UserId -- Loading Data local clicksData local success, errormessage = pcall(function() clicksData = clicksDataStore:GetAsync(playerUserId) end) if success then clicks.Value = clicksData end -- Loading Rebiths Data local rebirthsData local success, errormessage = pcall(function() rebirthsData = rebirthsDataStore:GetAsync(playerUserId) end) if success then rebirths.Value = rebirthsData end -- Loading Gems Data local gemsData local success, errormessage = pcall(function() gemsData = gemsDataStore:GetAsync(playerUserId) end) if success then gems.Value = gemsData end end) -- Saving Data game.Players.PlayerRemoving:Connect(function(player) local playerUserId = "player_" ..player.UserId -- Saving Clicks local clicksValue = player.leaderstats.Clicks.Value local success, errormessage = pcall(function() clicksDataStore:SetAsync(playerUserId, clicksValue) end) --Saving Rebirths local rebirthsValue = player.leaderstats.Rebirths.Value local success, errormessage = pcall(function() rebirthsDataStore:SetAsync(playerUserId, rebirthsValue) end) --Saving Gems Data local gemsValue = player.leaderstats.Gems.Value local success, errormessage = pcall(function() gemsDataStore:SetAsync(playerUserId, gemsValue) end) end) game:BindToClose(function(player) for _, Player in pairs(game.Players:GetPlayers()) do local playerUserId = "player_"..Player.UserId -- Saving Clicks local clicksValue = player.leaderstats.Clicks.Value local success, errormessage = pcall(function() clicksDataStore:SetAsync(playerUserId, clicksValue) end) --Saving Rebirths local rebirthsValue = player.leaderstats.Rebirths.Value local success, errormessage = pcall(function() rebirthsDataStore:SetAsync(playerUserId, rebirthsValue) end) --Saving Gems Data local gemsValue = player.leaderstats.Gems.Value local success, errormessage = pcall(function() gemsDataStore:SetAsync(playerUserId, gemsValue) end) end end)``