RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"it saves Rebirths but not Clicks and Rebirths fix it"
-- server script local playerData = game:GetService("DataStoreService"):GetDataStore("PlayerData") game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder", player) leaderstats.Name = "leaderstats" local rebirths = Instance.new("IntValue", leaderstats) rebirths.Name = "Rebirths" local clicks = Instance.new("IntValue", leaderstats) clicks.Name = "Clicks" local data = playerData:GetAsync(player.UserId) if data then rebirths.Value = data.Rebirths clicks.Value = data.Clicks end player.leaderstats.Rebirths.Changed:Connect(function() playerData:SetAsync(player.UserId, {Rebirths = rebirths.Value, Clicks = clicks.Value}) end) player.leaderstats.Clicks.Changed:Connect(function() playerData:SetAsync(player.UserId, {Rebirths = rebirths.Value, Clicks = clicks.Value}) end) end)