You can turn a dynamic light on with the
lighton action.
The
sound=$0 action plays a sound which you define in the entity properties in the editor.
There is also a loopsound=$0 action. This one has to be stopped with the
stopsound action if the sound is not meant to loop forever.
There are already simple scripts in your scriptbank which show how these actions can be used:
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
soundinzone.fpi
;Artificial Intelligence Script
;Header
desc = Sound In Zone
;Triggers
:state=0,plrwithinzone=1:state=1,sound=$0
and
soundloopinzone.fpi
;Artificial Intelligence Script
;Header
desc = Sound Looped In Zone (while player inside)
;Triggers
:state=0,plrwithinzone=1:state=1,loopsound=$0
:state=1,plrwithinzone=0:state=0,stopsound