// Callback function for when the lever's state changes
// EntityName is the name of the lever
// alState is the current state of the lever, -1 being low, 0 middle and 1 high *
void OnLeverStateChange(string &in EntityName, int alState)
{
// Do something when the state changes
// Optional debug message
AddDebugMessage(EntityName + "'s current state: " + alState, false);
if (alState == -1)
{
// Do something if the lever's state is low (or change it to 0 or 1)
}
}
// * low, middle and high are relative to its rotation.
Got it from the script recollection's thread. It's in the stickies. It's not that hard to find :<