Author Topic: Help with an if statement  (Read 331 times)

Legacy_Surek

  • Full Member
  • ***
  • Posts: 169
  • Karma: +0/-0
Help with an if statement
« on: July 09, 2014, 05:50:45 am »


               

if (!GetLevelByClass(CLASS_TYPE_WIZARD, oRespawner) && GetSubRace(oRespawner)!="Demonologist") && GetSubRace(oRespawner)!="Rune Caster")
   return;
effect eFail = SupernaturalEffect(EffectSpellFailure());
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eFail, oRespawner);

I was hopeing somone could help me. I have this script and I keep getting an error when I try to compile the script.


Basicly it works fine when it  checks for wizard and the first subrace but then i tryed adding the second subrace and i keep getting an error not sure what I'm doing wrong any help would be great. the error i'm getting unknown state in compiler.


 


Here is part of the script,


 


 



               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Help with an if statement
« Reply #1 on: July 09, 2014, 06:00:21 am »


               

if (!GetLevelByClass(CLASS_TYPE_WIZARD, oRespawner) && GetSubRace(oRespawner)!="Demonologist") && GetSubRace(oRespawner)!="Rune Caster")

return;


 


remove the red bracket


               
               

               
            

Legacy_Surek

  • Full Member
  • ***
  • Posts: 169
  • Karma: +0/-0
Help with an if statement
« Reply #2 on: July 09, 2014, 06:12:36 am »


               

Thank you it works now. '<img'>