Leaderstats saving and loading from AlvinBlox
game.Players.PlayerAdded:Connect(function(player) --leaderstats variables local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local Sips = Instance.new("IntValue") Sips.Name = "Sips" --load function with pcall local success, value = pcall(function() return myData:GetAsync(player.UserId) end) if success then Sips.Value = value print("Data was loaded successfully") end Sips.Parent = leaderstats end) --save data function game.Players.PlayerRemoving:Connect(function(player) local success, errormessage = pcall(function() myData:SetAsync(player.UserId, player.leaderstats.Sips.Value) end) if success then print("Data was saved successfull!") else print("There was an error when saving data!") warn(errormessage) end end)