I need help with this script that is suppose to show ranks on a leaderboard. Can anyone tell me what's wrong with it?
game.Players.PlayerAdded:connect(function(P)
repeat wait(1) until P:findFirstChild("leaderstats")
local Rank = Instance.new("StringValue", P.leaderstats)
Rank.Name = "Rank"
Rank.Value = P:GetRoleInGroup(3015629)
end)

2 comments
Any errors?
There is an object named leaderstats that gets added to the player, correct?