Skip to content

Instantly share code, notes, and snippets.

@Langerz82
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Langerz82/79acce714b77f3b8d481 to your computer and use it in GitHub Desktop.
Save Langerz82/79acce714b77f3b8d481 to your computer and use it in GitHub Desktop.
;/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ This script enables an ObjectReference like a door locked and unlocked
+ at specified intervals.
+ The Properties for this examples should be set too:
+ useLooking = TRUE ; We only want the interval to occur when in view.
+ fMinutesInterval = 5.0 ; Every five minutes in game time call OnTimeElapsed.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/;
ScriptName jlLockInterval extends ObjectReferenceInterval
bool isLocked = false;
; Overrided Function.
Event OnTimeElapsed()
Debug.Notification("jlLockInterval(Event:OnObjectElapsed)")
if (isLocked)
Self.Lock(FALSE, TRUE)
else
Self.Lock(TRUE, TRUE)
endif
isLocked = !isLocked
EndEvent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment