You put the script in Workspace because it is dealing with Leaderboards and we use the PlayerAdded event in game.Players. Oh and to add the code you press the Lua button while highlighting the code. (EDIT)
The code that was provided didn't work because it didn't name the stats Value to leaderstats.
local GroupID = 1
game.Players.PlayerAdded:connect(function(player)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local rank = Instance.new("StringValue", stats)
rank.Name = "Rank"
rank.Value =player:GetRoleInGroup(GroupID)
stats.Parent = player
end)
1 comment
I tried both of those, and it did not work. :C