why do i get this error

Post » Sun Jan 11, 2015 11:53 pm

I keep getting this error saying if on line 8 is mismatched when it isn't could someone please help i dont know how to attach a picture

script:

scn dangerblock

Short doOnce
short if
Begin OnActivate
if doOnce == 0
MessageBox "You hear the pvssyring of bones."
if isActionRef player == 1
Player.PlaceAtMe LL1UndeadLvl100, 1 128
Player.PlaceAtMe LL1UndeadLvl100, 1, 105, 2
Player.PlaceAtMe LL1UndeadLvl100, 1, 105, 3
set doOnce to 1
endif
end
User avatar
Jessica Lloyd
 
Posts: 3481
Joined: Fri Aug 25, 2006 2:11 pm

Post » Sun Jan 11, 2015 5:43 pm

It's mismatched because you need another "endif" in that code. Each if statement is the start of a block which needs to be closed. Alternatively, you could put "if isActionRef Player" and "if doOnce == 0" into one check:

if (isActionRef Player) && (doOnce==0)

endif

Also, "if" isn't a variable, it's a keyword. You don't need to declare it as a short at the start of your script - unless there's something else you're doing in this script with it that you haven't pasted.

User avatar
Michelle Smith
 
Posts: 3417
Joined: Wed Nov 15, 2006 2:03 am

Post » Sun Jan 11, 2015 5:22 pm

This works. Thanks alot

User avatar
Heather Kush
 
Posts: 3456
Joined: Tue Jun 05, 2007 10:05 pm


Return to IV - Oblivion

cron