i've never known how do i use Relays, though....
When you fire a relay on a brick, it triggers any and all events with onRelay.
Here's an example, it makes both of these things open a door.
onActivate -> Self -> fireRelay
onPlayerTouch -> Self -> fireRelay
onRelay -> Self -> door [OpenCCW]
fireRelay[direction] does the same thing, but in a direction. These're used to A. trigger the same events with different inputs (as above) and B. have multi-brick structures without named bricks (so you can, for instance, make TNT and a detonator without having all TNT on the map explode when the detonator for one is pushed.)
fireRelayNum does the same thing, but you specify what line numbers to fire, rather than all relays, meaning you can use relays to control multiple bricks.
Events are fun and someone should make an eventing tutorial save/mode/thing.