lilgamefreek Posted August 12, 2009 Share Posted August 12, 2009 I'm guessing you need to delete the else statement. That's causing the lights turn turn off should you activate the door with the lights on. So: ScriptName LightSwitchScript ref light Begin OnActivate if light == 0 set light to GetLinkedRef endif if light.GetDisabled light.Enable endif Activate End Link to comment Share on other sites More sharing options...
Cipscis Posted August 13, 2009 Share Posted August 13, 2009 If the code only needs to be run once, then you could condense the script even further by using your "light" variable in the same manner as a "doOnce" variable:ScriptName LightSwitchScript ref light Begin OnActivate if light else; if light == 0 set light to GetLinkedRef light.Enable endif EndCipscis Link to comment Share on other sites More sharing options...
Recommended Posts