Yeah, I wouldn't do it that way. I would use a timer. Something like this:
Code:
sub EVENT_ENTERZONE {
my $pet_id = $client->GetPetID();
if ($pet_id) {
quest::settimer($pet_id, 3);
}
}
sub EVENT_TIMER {
quest::stoptimer($timer);
$pet = $entity_list->GetNPCByID($timer);
$pet->Depop();
}
And if lag seems to still make it not catch the pet, move the entire function underneath the timer.