View Full Version : Syntax error

02-23-2009, 06:58 PM
Im trying to make this script and Im getting an error.

void main ()
object oNPC = GetObjectByTag("Tag");
AssignCommand (oNPC, ChangeObjectAppearance ( object oObjectToChange, int 516 );
Any ideas?

02-23-2009, 07:23 PM
A couple things here.

You need opening an opening brace { after the void main() and a closing brace } at the end of the script.

Keep in mind that when using GetObjectByTag you will need to change "Tag" to the actual Tag string specified in the .utc file of the NPC.

You will need a similar line to declare the oObjectToChange object.

You don't need the "int" before 516.

ChangeObjectAppearance doesn't need to be embedded within an AssignCommand function. You can call it directly instead.


void main () {
object oObjectToChange = GetObjectByTag("carth");
ChangeObjectAppearance(oObjectToChange, 516);

02-23-2009, 07:52 PM
Thanks Tk, it worked :)