So i copied a youtube tutorial from ripperoni on how to make a data saving leaderboard, and it worked for one of my intvalues "cash". I didn't know how to make a second stat so i pretty much just coped the cash one and made a 2nd data store called studsaving system and changed the name of cash to studs. Studs doesnt appear but cash works fine. Please help its 12am in the morning.
heres my code im sorry its not on each line idk how
local DataStore = game:GetService("DataStoreService") local ds = DataStore:GetDataStore("CashSaveSystem") local ds2 = DataStore:GetDataStore("StudsSaveSystem") game.Players.PlayerAdded:connect(function(player) local leader = Instance.new("Folder",player) leader.Name = "leaderstats" local Cash = Instance.new("IntValue",leader) Cash.Name = "Cash" Cash.Value = ds:GetAsync(player.UserId) or 0 ds:SetAsync(player.UserId, Cash.Value) Cash.Changed:connect(function() ds:SetAsync(player.UserId, Cash.Value) local studs = Instance.new("IntValue",leader) studs.Name = "studs" studs.Value = ds2:GetAsync(player.UserId) or 0 ds2:SetAsync(player.UserId, studs.Value) studs.Changed:connect(function() ds2:SetAsync(player.UserId, studs.Value) end) end) game.Players.PlayerRemoving:connect(function(player) ds:SetAsync(player.UserId, player.leaderstats.Cash.Value) ds2:SetAsync(player.UserId, player.leaderstats.studs.Value) end) end)