Jump to content

Open Gate scripting not working :(


DYNAMO

Recommended Posts

function createTheGate () 
  
  
   myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
  
  
end 
  
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
  
  
  
  
  
  
function openMyGate ( ) 
  
  
   moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947, 0, 0, 90 ) 
  
  
       setTimer ( movingMyGateBack, 5000, 1 ) 
  
  
end 
  
  
addCommandHandler("swat",openMyGate) 
  
  
  
  
  
function movingMyGateBack () 
  
  
   moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
  
  
end 

I tried this , but not working .

please help any admin , moderator , or any who know about it.

Link to comment

Mm try this.

function createTheGate30 () 
   myGate30 = createObject ( 971, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate30 ) 
  
  
function openMyGate30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
end 
addCommandHandler("swat1",openMyGate30) 
  
function movingMyGateBack30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 
addCommandHandler("swat2",movingMyGateBack30) 

Link to comment
Mm try this.
function createTheGate30 () 
   myGate30 = createObject ( 971, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate30 ) 
  
  
function openMyGate30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
end 
addCommandHandler("swat1",openMyGate30) 
  
function movingMyGateBack30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 
addCommandHandler("swat2",movingMyGateBack30) 

He don't want to close the gate by command, he wants to close by timer

Try this

function createTheGate () 
myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
function openMyGate ( ) 
moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947, 0, 0, 90 ) 
setTimer ( moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ), 5000, 1 ) 
end 
addCommandHandler("swat",openMyGate) 

Link to comment
Mm try this.
function createTheGate30 () 
   myGate30 = createObject ( 971, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate30 ) 
  
  
function openMyGate30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
end 
addCommandHandler("swat1",openMyGate30) 
  
function movingMyGateBack30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 
addCommandHandler("swat2",movingMyGateBack30) 

He don't want to close the gate by command, he wants to close by timer

Try this

function createTheGate () 
myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
function openMyGate ( ) 
moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947, 0, 0, 90 ) 
setTimer ( moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ), 5000, 1 ) 
end 
addCommandHandler("swat",openMyGate) 

Open and close with one command? o.O

Link to comment
Mm try this.
function createTheGate30 () 
   myGate30 = createObject ( 971, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate30 ) 
  
  
function openMyGate30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
end 
addCommandHandler("swat1",openMyGate30) 
  
function movingMyGateBack30 () 
   moveObject ( myGate30, 5000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 
addCommandHandler("swat2",movingMyGateBack30) 

He don't want to close the gate by command, he wants to close by timer

Try this

function createTheGate () 
myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ) 
end 
  
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
function openMyGate ( ) 
moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947, 0, 0, 90 ) 
setTimer ( moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 90 ), 5000, 1 ) 
end 
addCommandHandler("swat",openMyGate) 

Wrong timer.

@Just make sure you have it server side.

Edited by Guest
Link to comment

Try if the first one is rotates try the second one

function createTheGate () 
   myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947, 0, 0, 9 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
function openMyGate ( ) 
moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
setTimer ( movingMyGateBack, 5000, 1 ) 
end 
addCommandHandler("swat",openMyGate) 
  
  
function movingMyGateBack () 
   moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 

the second one

function createTheGate () 
   myGate = createObject ( 971 ,-3258.5517578125, 751.85546875, 116.78617095947 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) 
  
  
function openMyGate ( ) 
moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 90.78617095947 ) 
setTimer ( movingMyGateBack, 5000, 1 ) 
end 
addCommandHandler("swat",openMyGate) 
  
  
function movingMyGateBack () 
   moveObject ( myGate, 3000, -3258.5517578125, 751.85546875, 116.78617095947 ) 
end 

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