I′m currently working on my mod which should contain a feature as follows :
You are walking along a corridor and the light is supposed to go out and on as you pass further ( for a scary atmopshere

My idea was to add a trigger box which activates the script already given :
ScriptName ManualLightSwitch extends ObjectReference
{Controls a set of lights with a master enable parent
marker (EnableMarker) and a switch with this script
attached to turn on and off when the switch is activated}
ObjectReference Property EnableMarker auto
{The marker set as the enable parent of all the lights}
Event OnInit()
If (EnableMarker.IsDisabled())
GoToState("LightsOff")
Else
GoToState("LightsOn")
EndIf
EndEvent
State LightsOff
Event OnBeginState()
EnableMarker.Disable()
EndEvent
Event OnActivate(ObjectReference akActionRef)
GoToState("LightsOn")
EndEvent
EndState
State LightsOn
Event OnBeginState()
EnableMarker.Enable()
EndEvent
Event OnActivate(ObjectReference akActionRef)
GoToState("LightsOff")
EndEvent
EndState
Now I don′t know how to connect the trigger box correctly with the script.
I was trying to use the trigerboxes given in the warehouse_ambushes cell though it didn`t work at all
( even with a normal trap ).
I've only read the few tutorials on the creationkit site so I'm clearly a complete newbie concerning scripting. Therefore I would be very thankfull if some experienced scripter may help me with setting up this script

Don't know whether it's to complicated to add to the script to play a custom sound when triggering the box?
Thank you guys in advance!