"If" not allowed outside of main Function?

Post » Sun Feb 16, 2014 7:13 pm

Trying to get a handle on what is and isn't allowed in Papyrus. Right now, the following refuses to compile:

Event OnUpdate()If (Variable1 >= 40) && (Variable2 < 1)MySecondFunction()EndIfRegisterForSingleUpdate(0.5)endEvent
If I get rid of the if / endif, it likes it. If I move everything between Event / endEvent inside the main Function, it likes it. But having an if / endif (or while / endwhile) anywhere but inside the Function / EndFunction which gets called? Fails every time. I don't know how I'm supposed to have Events and other Functions in my script if I can't use important conditional checks inside them.
User avatar
CHangohh BOyy
 
Posts: 3462
Joined: Mon Aug 20, 2007 12:12 pm

Return to V - Skyrim