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