Jump to content

Trying to determine a target's class


Recommended Posts

Why doesn't this simple validation check return true?

 

SCN aaaScript

REF Target

BEGIN ScriptEffectStart

SET Target TO GetActionRef

IF (Target.IsGuard == 1)
	Target.Kill
ELSE 
	Message "Nope."
ENDIF

End

 

I use the spell on an Imperial Guard, which of course is of the Guard class, so why won't this script kill the guard?

Link to comment
Share on other sites

Why doesn't this simple validation check return true?

 

*snip*

 

The problem is most likely due to using GetActionRef, which is mostly just useful in OnTrigger and OnActivate blocks . Try using GetSelf instead, like this:

 

SCN aaaScript

REF Target

BEGIN ScriptEffectStart

SET Target TO GetSelf

IF (Target.IsGuard == 1)
	Target.Kill
ELSE 
	Message "Nope."
ENDIF

End

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...