Group door error

I have made a group door script and it checks if the player is in the teams group and if he is then it will open but if he isn’t in it and still has a certain clearance level in the main group then he can open the door.

This is what I have but I keep getting error attempt to compare string and number

if Player:IsInGroup(123543) or Player:GetRankInGroup(653432) >= 5then
1 Like

Make a space between 5 and then.

after then you put your code.

There is a space in the actual code the numbers here are random

Can we see the entire code then that will help us to assist you.

Event = game.ReplicatedStorage.Event

Event.OnServerEvent:connect(function(Player, Rank, GroupID)


if Player:IsInGroup(GroupID) or Player:GetRankInGroup(7) >= Rank then
		print("Granted")		
	else
		print("Denied")
end
end)

What data type are you sending for parameter/argument Rank?
and what did type did you except Rank to be?
It looks like the parameter Rank is a string.

Wait can I not send numbers through string values?

tonumber(Rank),

1 Like

Nope, you can’t send numbers through string values you’ll need NumberValue for float and IntValue for integer. Why are you sending numbers through string values?
You could do tonumber(Rank)

1 Like