I created a function to get the rank of a player within a group, and it looks like this when I run it:
ranking.Value = getRank(shirts.Value, player)
On this line, the script gives me an error:
INVALID ARGUMENT #3: (String expected, got nil)
On the function, there are only 2 Arguments. Does anyone know about the possible causes of this?
local getRank = function(shirtsBought, playerGuy)
if shirtsBought == 0 then
return "Supporter"
elseif shirtsBought >= 3 then
if shirtsBought >=5 then
if shirtsBought >= 8 then
if shirtsBought >= 11 then
if shirtsBought >= 15 then
if shirtsBought >= 20 then
if shirtsBought >= 25 then
if shirtsBought >= 30 then
if shirtsBought >= 40 then
local groupInfo = game:GetService("GroupService"):GetGroupInfoAsync(11352987)
if playerGuy:GetRankInGroup(11352987) ~= (240 or 241) then
return "CUSTOM RANK"
end
return groupInfo[playerGuy:GetRankInGroup(11352987)]
end
return "Insane Buyer"
end
return "Nike Obsession"
end
return "Demonic"
end
return "Legend"
end
return "Elite"
end
return "Superstar"
end
return "Pro"
end
return "Rookie"
end
end