Attempt to compare string and number

So I am trying to make it that if you have the following rank or lower you will get the desired clothes, and it errors at the module part. Here is the module’s code.

local module = {}

function module:CheckRank(Player, Character, Clothing)
	if Player:GetRoleInGroup(4178207) <= 9 then
		Character:WaitForChild("Shirt").ShirtTemplate = Clothing[Clothing].Shirt
		Character:WaitForChild("Pants").PantsTemplate = Clothing[Clothing].Pants

return module

GetRoleInGroup returns a string, or the roles name. You should be using GetRankInGroup which returns a number, like your trying to use above.


Its the

that is the issue, simply change it to player:GetRankInGroup(4178207) <= 9 then
:GetRankInGroup gets the role ID
:GetRoleInGroup gives the role name

1 Like

Thank you, @uD0ge and @SquidyCakez for the answer I completely forgot about this function.

1 Like

No problem, dont worry we all forget things sometimes! :smiley: