I made a custom leaderboard, yet it will not work, it says I have no errors, please help
game.Players.PlayerAdded:connect(function(plr) local stats =game.Players.LocalPlayer.Instance.new("IntValue", plr) stats.Name = 'leaderstats' stats.Value = 0 local Rank = game.Instance.new("StringValue", stats) Rank.name = 'NYP Rank' Rank.Value = plr:GetRoleInGroup(2841538) stats.Parent = plr Rank.Parent = stats end)
Thanks, and happy thanksgiving o3o -Rich
Here is some fixed code, with explanations:
game.Players.PlayerAdded:connect(function(p) local stats = Instance.new("Folder") -- Folder because it is better for organization stats.Parent = p stats.Name = "leaderstats" -- I missed this, but it is required to be named leaderstats for it to show up local rank = Instance.new("StringValue") -- Using the second parameter is less efficient rank.Parent = p rank.Name = "NYP Rank" -- Lua is case-sensitive rank.Value = p:GetRoleInGroup(2841538) -- There is no need to set the parents again end)
Hope I helped!
~TDP