Quote:
Originally Posted by Cisyouc
Code:
sub EVENT_SAY
{
if($text=~/hail/i)
{
if($solusek == "")
{
quest::say("Hello, would you like to [help] me?");
$solusek="";
}
elsif($solusek=="1")
{
quest::say("Thanks for helping me!");
$solusek="";
}
}
if($text=~/help/i)
{
quest::targlobal("solusek","1","Y5",281099,$charid,26);
quest::me("You have recieved a character flag!");
}
}
But THIS doesnt work either.
|
If $solusek doesn't exist I don't think ($solusek == "") will ever be true. You should reverse the two and have only an else for the default case. You always want one to happen no matter what so they should not all have conditions. Like this:
Code:
sub EVENT_SAY
{
if($text=~/hail/i)
{
if($solusek=="1")
{
quest::say("Thanks for helping me!");
$solusek="";
}
else
{
quest::say("Hello, would you like to [help] me?");
$solusek="";
}
}
if($text=~/help/i)
{
quest::targlobal("solusek","1","Y5",281099,$charid,26);
quest::me("You have recieved a character flag!");
}
}
That way one or the other always happens when they say hail.