Shamanas Posted April 22, 2014 Share Posted April 22, 2014 Hello it's my next post and i have question how i need make gates open and close with a random code and please say where i need to write it cheez for reading (sorry for bad english) Link to comment
justn Posted April 23, 2014 Share Posted April 23, 2014 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
Vinctus Posted April 23, 2014 Share Posted April 23, 2014 https://forum.multitheftauto.com/viewtopic.php?f=91&t=39795 Link to comment
Rahul Sharma Posted June 15, 2014 Share Posted June 15, 2014 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
justn Posted June 17, 2014 Share Posted June 17, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now