Simple light
From GMod Wiki
Simple Light
Simple light: Simple Light |
Description: | A simple switchable light through wire. |
Original Author: | User:Chronic |
Created: | 12 July 2007 |
Notes: | - |
Materials
- A flat surface or prop.
- A wire Light with the radiant flag checked.
- A Gate - Arithmetic, Multiply chip.
- A Constant Value for 255.
- A wire Button set to toggle with on value 1 and off value 0.
Set-up
- Place the wire Light on the prop or surface.
- Place your Gate - Arithmetic, Multiply under the light.
- Place your Constant Value next to the chip with the value 255.
- Place a Button next to all of this.
Wiring
- Select the Wire STOOL.
- Left-click the light and then left-click on the chip. Right-click the light, left-click the light, and then left-click the chip. Right-click the light twice, left-click the light, and then left-click the chip.
- Left-click the chip and then left-click the Constant Value. Right-click the chip, left-click the chip, and then left-click again on the Button.
You'rer finished! Press the button and watch as your new wire contraption lights up.
Explanation
The gate multiplies two things: the Constant Value and a variable (the button). When the variable is zero (the button is off) the gate multiplies 255 from the Constant Value and the off value of the button, 0. 255 * 0 = 0 and therefore the light stays unlit. When the variable is one however, (button is on) the gate multiplies 255 and one. 255 * 1 = 255 which tells the light to glow a bright white.