View Single Post
Old 04-03-2012, 01:30 AM   #5
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,256
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
Booleans in nwscript are kinda weird.

You'll have better results if you put:

Code:
void main(){

	object oPC=GetFirstPC();
	object oPlaceable = GetObjectByTag("lockerlg001");

	if (GetLocalBoolean(oPlaceable, 40)) 
  		AddJournalQuestEntry("DT_MERC", 32);

	else
  		AddJournalQuestEntry("DT_MERC", 30);
}
That said, if you still want to use your original script, you have to make sure that you close the brackets for the if statement. To better illustrate the issue:

Code:
YOUR CODE
	if ( iResult == FALSE) {


		AddJournalQuestEntry("DT_MERC", 30);
  	
		if ( iResult == TRUE) {

			AddJournalQuestEntry("DT_MERC", 32);
  
		}
	}

	
SHOULD BE


	if ( iResult == FALSE) {


		AddJournalQuestEntry("DT_MERC", 30);
	}
  	
	if ( iResult == TRUE) {

		AddJournalQuestEntry("DT_MERC", 32);
  
	}

VarsityPuppet is offline   you may: quote & reply,