Why are you choosing to use GetRoleInGroup as opposed to GetRankInGroup as surely this would be far more reliable as you would only have to compare numerical values as opposed to strings which can help make it all a bit less confusing. GetRoleInGroup is only really ideal for things like overhead GUIs and leaderboard rank displays and shouldn’t be used for checking someones rank in a group.
A script which would preform the same functionality and should work could look something like this:
local function checkGiveStaffMemberHisPanel(plr)
if plr:GetRankInGroup(GroupId)==255 then -- replace 255 with the rank number
Givepannel()
elseif plr:GetRankInGroup(GroupId)==5 then
Givepannel()
end
end
I have also used an elseif statement in the above code just so that it is a bit neater instead of having individual if statements for each panel check
Hope this is able to somewhat help