client ~
Opc = true
addEventHandler ("onClientGUIClick", root,
function ()
if source == m then
if ( Opc == true ) then
triggerServerEvent ( "OpenB", localPlayer )
guiSetText (m,"Close")
guiSetProperty(m, "NormalTextColour", "FFFF0000")
Opc = false
else
triggerServerEvent ( "CloseB", localPlayer )
guiSetText (m,"Open")
guiSetProperty(m, "NormalTextColour", "FF00FF00")
Opc = true
end
end
end
)
server ~
TheDoor = createObject (17951 ,96.699996948242,1920.6999511719,18.89999961853 ,0,0,0)
addEvent( "OpenB", true )
addEventHandler("OpenB", root,
function ()
moveObject (TheDoor,1000,-536.90002441406,3821.8000488281,5.4000000953674)
end
)
addEvent( "CloseB", true )
addEventHandler("CloseB", root,
function ()
moveObject (TheDoor,1000,96.699996948242,1920.6999511719,18.89999961853)
end
)