Jump to content

MTA:DayZ Help ! (With Gate Opening And Closing With An Code)


Shamanas

Recommended Posts

Try this.

-- X ( Position X ), Y ( Position Y ), Z ( Position Z ), rotX ( rotation X ), rotY ( rotation Y ), rotZ ( rotation Z) 
local gate = createObject( Object ID, x, y, z, rotX, rotY, rotZ ) 
addCommandHandler("open", 
function() 
moveObject(gate, 2500, x,y,z) -- Moves the object to the position x,y,z 
end 
) 
  
addCommandHandler("close", 
function() 
moveObject(gate, 2500, x,y,z) -- Close the gate ( same x,y,z u used to create the gate ) 
end 
) 

Link to comment
  • 1 month later...

i have problem with my gates scripting my lua file tht i use is as follows

gate1 = createObject ( object (a51_jetdoor) (11),-2439.599609375, 1538.099609375, 14.699999809265, 0, 0,0 )

function gate1Open

moveObject ( gate1, 2000, -2439.6000976563, 1546.3000488281, 14.699999809265 )

end

addCommandHandler("main", gate1Open)

function gate1Close

moveObject ( gate1, 2000, -2439.6000976563, 1538.0999755859, 14.699999809265)

end

addCommandHandler("main", gate1Close )

now how do i test dis in map editor i test it but the gate doesnt open im going mad with ths pls help me guys

Link to comment
gate1 = createObject ( MODEL ID HERE,-2439.599609375, 1538.099609375, 14.699999809265, 0, 0,0 ) 
  
function gate1Open() 
moveObject ( gate1, 2000, -2439.6000976563, 1546.3000488281, 14.699999809265 ) 
end 
addCommandHandler("main", gate1Open) 
  
function gate1Close () 
moveObject ( gate1, 2000, -2439.6000976563, 1538.0999755859, 14.699999809265) 
end 
addCommandHandler("main", gate1Close ) 

and use the object model ID

https://wiki.multitheftauto.com/wiki/CreateObject

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...