Quote: "Can you write scripts to destroy an entity and the light goes out?"
In the destroy script for the entity, ensure you use "settargetname=x", where X is the name you use for the light marker; then use "activatetarget=1". In the script for the light, you have a section where it is checking to see if it has been "activated" and if so, it then uses the "lightoff" command.
For example... here is a sample default destroy script used, called "disappear1.fpi":
crate's disappear1.fpi
;Artificial Intelligence Script
;Header
desc = Instant Off
;Triggers
:state=0:state=1
:state=1:settargetname=NAMEOFLIGHTMARKER,activatetarget=1,state=2
:state=2:destroy
;End of Script
Then we have the script for the light marker. Make sure it is "dynamic" or the script does nothing.
light1.fpi"
;Artificial Intelligence Script
;Header
desc = Light Toggle (On By Default)
;Triggers
:state=0:state=1
:state=1,activated=0:state=2,lighton
:state=2,activated=1:state=1,lightoff
;End of Script
When the player destroys the crate, it will activate the set target name. So if you placed a light marker and call it "light1", then in the script you need to have "settargetname=light1". Once activated, the light turns off.
There's no problem that can't be solved without applying a little scripting.