Jump to content

[HELP] Script


MAACC

Recommended Posts

Greetings , sorry for the inconvenience , please , if I can help with this little Script truth I got a little tangled, because not much about it , because I want to do is that with a single command to open and close said barrier , but and tried and what it does is go for anywhere but where it should , if you please can you help me I would appreciate it very much.

function createTheGate ()

myGate1 = createObject ( 968, -96.900001525879,1208.5999755859, 19.5 , 0, 269.25, 1.9999389648438)

end

addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate )

function openMyGate ( )

moveObject ( myGate1, 4500, -96.900001525879,1208.5999755859, 19.5, 0, 60, 0 )

end

addCommandHandler("abrirbarrera",openMyGate)

function movingMyGateBack ()

moveObject ( myGate1, 4500, -96.900001525879,1208.5999755859, 19.5, 0, -60, 0)

end

addCommandHandler("cerrarbarrera",movingMyGateBack)

Link to comment
  
function createTheGate () 
    myGate1 = createObject ( 968, -96.900001525879,1208.5999755859, 19.5 , 0, 269.25, 1.9999389648438) 
end 
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
local open = false 
function openMyGate ( ) 
    if open then 
        moveObject ( myGate1, 4500, -96.900001525879,1208.5999755859, 19.5, 0, -60, 0) 
        open = false 
    else 
        moveObject ( myGate1, 4500, -96.900001525879,1208.5999755859, 19.5, 0, 60, 0 ) 
        open = true 
    end 
end 
addCommandHandler("barrera",openMyGate) 
  

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...