yourGatesName = createObject ( Object id, x, y, z, rotX, rotY, rotZ)
[color=#0040FF][b]function[/b][/color] openGate (source)
[color=#FF0000][b]moveObject[/b][/color] (yourGatesName, int time, new pos X, new pos Y, new pos Z) -- example time = 3500, and the coordinates where you want the object to end up
[color=#FF0000][b]outputChatBox[/b][/color] ("You opened your gate!" source, 255, 255, 255) --optional, but its my habit to see if the function was made right
[color=#0040FF][b]end[/b][/color]
addCommandHandler ("open", openGate ) -- OR doors?
for automatic gates
[color=#0040FF][b]local[/b][/color] firstGateMarker = createMarker ( x, y, z, "corona", size, R, G, B, Alpha ) --Outside the door
[color=#0040FF][b]local[/b][/color] secondGateMarker = createMarker ( x, y, z, "corona", size, R, G, B, Alpha ) -- Inside the door
yourGatesName = createObject ( Object id, x, y, z, rotX, rotY, rotZ)
[color=#0040FF][b]function[/b][/color]
[color=#FF0000][b]moveObject[/b][/color] (yourGatesName, int time, new pos X, new pos Y, new pos Z)
[color=#0040FF][b]end[/b][/color]
addEventHandler( "onMarkerHit", firstGateMarker, yourGatesName)
addEventHandler( "onMarkerHit", secondGateMarker, yourGatesName )