Hi, I'm making a leader board, but how would I make it have KOs for money, and Data Store? Thanks! Here's my current leader board:
game.Players.PlayerAdded:connect(function(player) local stats = Instance.new('IntValue', player) stats.name = 'leaderstats' local money = Instance.new('IntValue', stats) money.Name = 'Money' money.Value = 0 end)
local ds = game:GetService("DataStoreService"):GetDataStore("Leaderboard") game.Player.PlayerAdded:connect(function(player) local tab = ds:GetAsync(player.userId.." Data") if not tab then tab = {{"Money","IntValue",0},{"AddAnotherValueHere","IntValue",0}} end local stats = Instance.new("IntValue",player) stats.Name = "leaderstats" for i = 1,#tab do local val = Instance.new(tab[i][2],player) val.Value = tab[i][3] val.Name = tab[i][1] end end)
Basically in the tab there's tables set up like {"ValueName","ValueType",Value}