Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

I dont know what im doing wrong?!?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago
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)
0
You need to provide explanation as well. coo1o 227 — 10y
Ad
Log in to vote
-1
Answered by 10 years ago

Try making the variable GroupID global instead of local.

Answer this question