Having a problem with this script. It creates the instance and ports the player properly and all. The problem I'm having is it does not assign everyone in the group to the same instance ID. The 2nd player to hail will be assigned a different Instance ID, and it will try to zone them, but then they just end up back in PoK. I'm stumped. I don't know much about qglobals yet, am I missing something I need to do with them?
Code:
sub EVENT_SAY {
$inpoka = quest::GetInstanceID("akanon",0);
$group = $client->GetGroup();
if ($text =~/hail/i) {
#quest::say ("hi");
if($inpoka == 0) {
$Instance = quest::CreateInstance("akanon", 1, 64800);
quest::AssignGroupToInstance($Instance);
quest::say("Instance added.");
quest::say("Your instance is: $Instance");
#quest::setglobal($name."poknowledgea",$Instance,7,"H18");
#quest::setglobal($name."zone",$Instance,7,"H18");
quest::MovePCInstance(55, $Instance, 788.7,-496.3,-126.1);
} else {
$client->Message(13, "You are already in an instance, the ID which is $inpoka");
quest::say("If you wish to [return] to this instance, just say so!");
}
}
if ($text =~/return/i) {
quest::MovePCInstance(55, $inpoka, 788.7,-496.3,-126.1);
}
if ($text =~/46/i) {
quest::DestroyInstance(48);
}
}