IV4 Posted January 8, 2005 Share Posted January 8, 2005 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 More sharing options...
Marxist ßastard Posted January 8, 2005 Share Posted January 8, 2005 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. http://forum.gamingsource.net/style_images/mp-blue%5B1%5D/p_up.gif IV4: if (Celli=1) There are three things wrong with this line:You must put spaces on either side of a mathematical operator.The operator here should be "==," not "=."You must insert spaces between parenthesis and any other charachter that is part of that lineBesides 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.