On this script as soon as you hail him he transferes you. I added a little bit to the top just so that it wouldnt instantly transfer if you accidentally hail him/her.
Code:
sub EVENT_SAY {
if ($text =~/hail/i)
{
quest::say("Hello $name, would you like to be transfered to your [GuildHall]?");
}
if($text =~/Guildhall/i)
{
quest::say("Let me see...");
if($uguild_id > 0)
{
if (defined($qglobals{"GuildInstance_$uguild_id"}))
{
my $QGlobalValue = $qglobals{"GuildInstance_$uguild_id"};
quest::AssignToInstance($qglobals{"GuildInstance_$uguild_id"});
quest::MovePCInstance(345, $QGlobalValue, 0, 0, 0);
quest::say("Moving you to the instance now");
}
else
{
quest::say("No instance existed, so creating one");
my $instanceID = quest::CreateInstance("guildhall", 0, -1);
quest::AssignToInstance($instanceID);
quest::setglobal("GuildInstance_$uguild_id",$instanceID,7,"M60");
quest::MovePCInstance(345, $instanceID, 0, 0, 0);
quest::say("Moving you to the instance now");
}
}
else
{
quest::say("I am sorry but you are not part of a guild");
}
}
}