
int iDoOnceif !iDoOnce ;do stuff here iDoOnce = 1endif
int iDoOnceif !iDoOnce ;do stuff here iDoOnce = 1endif
Event OnInit() ; Do stuff Debug.Notification("Stuff has been done") GotoState("Done")EndEventState Done ; Nothing happens in this stateEndStateIn that example, the state isn't actually necessary because the http://www.creationkit.com/OnInit event wouldn't run again until the object is reset, at which point the state also gets reset, but if you were to add more stuff to the script, like other events, that shouldn't be called in the "Done" state then it would be appropriate.
bool bDoOnce = falseif !bDoOnce ;do stuff here bDoOnce = trueendif
bool bDoOnce = falseif !bDoOnce ;do stuff here bDoOnce = trueendif