local x,y,z = getElementPosition(door)
function onResourceStart()
door = createObject(3095,1279.9134521484,-2054.0205078125,62.628402709961,0,271.07666015625,0)
end
addEventHandler("onResourceStart", resourceRoot, onResourceStart)
function move(thePlayer,cmd)
if ( z == 62.628402709961 ) then
moveObject ( door, 10000, x, y, z + 10 )
else
outputChatBox("Door is already open",thePlayer,0,255,0,true)
end
end
addCommandHandler ( "dooropen", move)
function movez(thePlayer,cmd)
if ( z == 72.628402709961 ) then
moveObject ( door, 10000, x, y, z - 10 )
outputChatBox("Door is already closed",thePlayer,0,255,0,true)
else
end
end
addCommandHandler ( "doorclose", movez)
The real fixed verison ^^
(untested)