Here’s what the code would look like, assuming you also want the lights to turn off after leaving the area. In Verse, for collision zones to detect overlapping players, you need to use mutator devices. Once players enter/exit the zone, you can just add the code of other devices inside the enter/exit function, or you can trigger a sensor (which you mentioned) like I show below, which can trigger other existing devices. Of course after adding this code, you’d need to “build verse code” so that the editor updates. Once updated, you add these devices into the map and assign them into the editor fields - which is only possible now that you have “editable” before each device. Hope this makes sense!
editable Zone : mutator_zone_device : mutator_zone_device {}
editable SensorOn: trigger_device = trigger_device {}
editable SensorOff: trigger_device = trigger_device {}
editable Light : customizable_light_device = customizable_light_device {}
OnBegin() : void =
Zone.AgentEntersEvent.Subscribe(OnAgentEnters)
Zone.AgentExitsEvent.Subscribe(OnAgentExits)
SensorOn.TriggeredEvent.Subscribe(OnSensorOn)
SensorOff.TriggeredEvent.Subscribe(OnSensorOff)
OnAgentEnters(Agent : agent) : void =
SensorOn.Trigger(Agent)
OnAgentExits(Agent : agent) : void =
SensorOff.Trigger(Agent)
OnSensorOn(Agent : agent) : void =
Light.TurnOn( )
#Add custom code to implement functions from other existing devices
OnSensorOff(Agent : agent) : void =
Light.TurnOff( )
#Add custom code to implement functions from other existing devices