Jump to content

I have a problem...


IV4

Recommended Posts

I want that one creature attacks NPC!

I have written a script like this:

 

begin POR

 

short Celli=GetPCCell, Balmora

 

if (Celli=1)

 

StartCombat, AA_WARNER

 

endif

 

return

 

end POR

 

What is the problem? Why doesnt this work? How Can i make this work?

HELP ME PLEASE!

Link to comment
Share on other sites

http://forum.gamingsource.net/style_images/mp-blue%5B1%5D/p_up.gif  IV4:

 

begin POR

short Celli=GetPCCell, Balmora

 

You cannot declare and initialize a variable on the same line -- you would need to use a Set command (on a separate line from the variable declaration) to give the variable a value. Additionally, when you use the Set command, you will need to enclose any commands in parenthesis.

 

 

There are three things wrong with this line:

  1. You must put spaces on either side of a mathematical operator.
  2. The operator here should be "==," not "=."
  3. You must insert spaces between parenthesis and any other charachter that is part of that line

Besides that, you can reference the results of a command directly within a conditional statement, meaning that you do not need to use a variable to act as the man in the middle. Thus, your script should be more like this:

 

Begin PDR

If ( GetPCCell Balmora );A comma between the command and the first operator isn't strictly required.  Additionally, if you neglect to put a mathematical operator and reference value within a conditional statement, the compiler puts in a "> 0" automatically.
 StartCombat AA_WARNER
EndIf

End

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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