I think I went over this before with you a while back, but the GetID() does work fine every time for groups as long as you have the script setup properly.
Some things to note about your script example there are:
You need to verify that a group exists for the player before getting the ID of the group:
This:
Code:
my $ClientGroup = $client->GetGroup();
my $GroupID = $ClientGroup->GetID();
Should be:
Code:
my $ClientGroup = $client->GetGroup();
my $GroupID = 0;
if ($ClientGroup) {
$GroupID = $ClientGroup->GetID();
}
You can add that at the beginning of your event (such as EVENT_SAY) and then you won't need to do that check again within that particular event. You can't do that check outside of a sub event, because that stuff is only loaded at the time the NPC spawns.
If you have any problems with it, maybe we can chat on IRC or something.