This code looks like it was originally made when you had to query separate functions and use separate events for group sizes. Something like this would be much simpler now. I use kgpanels but without custom code, so I'm going to assume there are places to put the OnLoad and OnEvent parts and you aren't literally putting all of this into the same code box.
Lua Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("GROUP_ROSTER_UPDATE")
The OnLoad part, which is the same for all three. PARTY_MEMBERS_CHANGED and RAID_ROSTER_UPDATE no longer exist, it is just GROUP_ROSTER_UPDATE now.
Lua Code:
if GetNumGroupMembers()>20 then
self:Show()
else
self:Hide()
end
more than 20 players
(I'm going to assume you want something shown when there are 21 players, because the logic you wanted would show nothing when you have exactly 21 players)
Lua Code:
if GetNumGroupMembers()<21 and IsInRaid() then
self:Show()
else
self:Hide()
end
1-20 players in a raid
Lua Code:
if GetNumGroupMembers()>0 and not IsInRaid() then
self:Show()
else
self:Hide()
end
in a party