Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I dont know what im doing wrong?!?

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)

2 answers

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)

1 comment

0

You need to provide explanation as well.

Try making the variable GroupID global instead of local.

This discussion is preserved as it was. New answers, comments, and votes are closed.