Using OR in NPC script
Some strange happenings going on. Awhile ago I tried writing a simple script which would provide a slightly altered quest for each player based on their class. Basically it went something like if $class="Shadowknight" or $class="paladin" { blah blah }. Anyways, I lost the original script when I painstakingly removed all my OR's so I didn't have anything concrete to submit. I don't have direct access to the NPC scripts, but go through someone else and didn't want to trouble him.
However, yesterday one of the other quest writers came acros the same thing so I wanted to submit his example so I can try and figure out why I can't even use a simple OR statement? *NOTE* In my original example, I used double quotes and when I saw the preliminary quest submitted, I saw that he used single quotes and figured maybe I missed something, but they both cause the NPC to seize up and become unresponsive. Code:
if ($class !='shadowknight' || $class !='necromancer') { |
When using classes and eq (equal for strings) or ne (not equal for strings), you will need to capitalize the class. So for your given example:
Code:
if ($class ne "Shadowknight" || $class ne "Necromancer") { |
Ahhh! Wonderful! This will save me a lot of work in the future. Thanks!
|
All times are GMT -4. The time now is 11:03 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.