This is a script for a broken transformer that leaks radiation to the surrounding area as well as controlling the lighting for multiple rooms.
What is interesting about this script is that it accounts for a variety of possibilities.
- the radiation leak is fixed but the lights are still off
- the lights are on but radiation leak is not fixed.
- both the lights and radiation leak are fixed
- neither the lights or radiation leak are fixed.
The bit at the beginning prevents the message boxes from appearing if the player is in combat.
There's also some nice production value in this script. While the lights are being changed over the screen does a fade and player control is temporarily removed for a few moments.