BubaDragons lever animator

What it does
This is a simple script that plays the animation for a switch. Simply place this file in your scripttemplates directory and when you want to animate a switch select the Templates button and this file will be selectable

The Script
//:://////////////////////////////////////////////////////////////// //:: Name //:: OnUse_Switch_Scipt //:://////////////////////////////////////////////////////////////// /* ***************************************************************** //:://////////////////////////////////////////////////////////////// //:: Created By: BubaDragon //:: Created On: 09-October-2002 //:://////////////////////////////////////////////////////////////// void ActionUseSwitch; void main {  ActionUseSwitch; } void ActionUseSwitch {  int iOn = ANIMATION_PLACEABLE_ACTIVATE; int iOff = ANIMATION_PLACEABLE_DEACTIVATE; int iAnimationState = GetLocalInt(OBJECT_SELF, "AnimationState"); iAnimationState = (iAnimationState == iOff)?iOn:iOff; ActionPlayAnimation(iAnimationState); SetLocalInt(OBJECT_SELF, "AnimationState", iAnimationState); }
 * This is a simple script that plays the animation for
 * a switch. Simply place this file in your scripttemplates
 * directory and when you want to animate a switch select
 * the Templates button and this file will be selectable.
 * NOTES: This works best if the switch is placed with it's
 * "Initial State" set to either Activated or
 * Deactivated *NOT* default. If the switch
 * dosen't work 'right' the first time but behaves
 * correctly after that, the switch was placed with
 * it's initial state set to "default".
 * Depending on weather or not the initial state is
 * Activated or Deactivated you may want to change
 * the line:
 * iAnimationState = (iAnimationState == iOff)?iOn:iOff;
 * To:
 * iAnimationState = (iAnimationState == iOn)?iOff:iOn;
 * By commenting out the main this file can be used as a
 * #include file.
 * #include file.