VERY Simple 2-way Door

From GMod Wiki

Jump to: navigation, search

(Original tutorial by Smako, updated by Immibis for the Expression 2 chip and cleanup)

This is my first tut, and it will be on how to make a simple 2-way door with the Expression 2 chip.

1. Spawn a door, any kind you like, and ballsocket it to another entity (world, another prop, etc...)

2. Wire up from the top corner, the furthest away from the ballsocket, a wire hydraulic.

3. Spawn a Button, Keypad, or anything that can output 1 or Greater when in use on one side of the door. Spawn another on the other side. They do not have to be the same type of device.

4. Spawn an Expression Chip with this Script:

@name Door
@inputs Open1 Open2
@outputs Length
@trigger all
if(Open1 | Open2)
{
  Length = 210
  timer("close", 5000)
}
if(clk("close"))
{
  Length = 0
}

5. Wire the Open1 and Open2 inputs to the buttons or keypads (or other devices) on each side of the door. Wire the Length input of the hydraulic to the Length output of the E2.

Press the button/keypad, and the door should open!

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox