Please fix this?
01 | local GroupID = 1072475 |
02 |
03 | game.Players.PlayerAdded:connect( function (player) |
04 | local stats = Instance.new( "IntValue" ) |
05 | local rank = Instance.new( "StringValue" , stats) |
06 | rank.Value = player:GetRoleInGroup(GroupID) |
07 | stats.Parent = player |
08 | --[[player.CharacterAdded:connect(function(character) |
09 | local groupSpawns = game.Workspace:FindFirstChild("GroupSpawns"):GetChildren() |
10 | local torso = character:WaitForChild("Torso") |
11 | torso.CFrame = CFrame.new(groupSpawns[math.random(1,#groupSpawns)].Position) |
12 | end)]] |
13 | end ) |
01 | local GroupID = 1072475 |
02 |
03 | game.Players.PlayerAdded:connect( function (player) |
04 | local stats = Instance.new( "IntValue" ) |
05 | stats.Name = "leaderboard" |
06 | local rank = Instance.new( "StringValue" , stats) |
07 | rank.Name = "Rank" |
08 | rank.Value = player:GetRankInGroup(GroupID) -- Here was the error. |
09 | stats.Parent = player |
10 | end ) |
Corrected...
01 | local GroupID = 1072475 |
02 |
03 | game.Players.PlayerAdded:connect( function (player) |
04 | local stats = Instance.new( "IntValue" ) |
05 | stats.Name = "leaderboard" |
06 | local rank = Instance.new( "StringValue" , stats) |
07 | rank.Name = "Rank" |
08 | rank.Value = tosting(player:GetRoleInGroup(GroupID)) -- Here is corrected |
09 | stats.Parent = player |
10 | end ) |
Try making the variable GroupID global instead of local.