Quote:
Originally Posted by Magoth78
Hello,
I'm pretty new at quest scripting and i've looked for $race in the search forum but I did not find the solution at my problem.
I'm just trying to get a npc to say the race of the player that hails him... pretty simple you say me... probably not for me...
Code:
sub EVENT_SAY
{
if ($text=~ /Hail/i)
{
if($race == Erudite)
{
quest::say("Erudit");
}
if($race == Darkelf)
{
quest::say("Dark elf");
}
}
}
I've tested whit a human character, hailed the npc and he says me Erudit then Dark elf, even if I'm a human. I think it's due to the $race == xx.
Can someone help me please?
thx by advance
|
Try this code. I think all you need are quotes around the race and correct spelling (Dark Elf not Darkelf).
Code:
sub EVENT_SAY
{
if($text~/hail/i)
{
if($race == "Human")
{
quest::say("You are a human.");
}
else
{
quest::say("FOOL! You are a $race not a human!");
}
}
}