Advertisement
NanoBob

Missile silo script

May 11th, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.57 KB | None | 0 0
  1. jetdoor=createObject(3095,268.70001220703,1883.4000244141,16)
  2. rocket=createObject(3786,268.60000610352,1883.8000488281,-15,0,90,0)
  3. setObjectScale(rocket,13)
  4. blastdoor1=createObject(2929,215.8994140625,1875.5999755859,13.89999961853)
  5. blastdoor2=createObject(2927,211.9,1875.5999755859,13.89999961853)
  6. labdoor=createObject(2951,268.70001220703,1863.9000244141,7)
  7. blastdoorzone=createColSphere(213.80000305176,1876.1999511719,12.1,15)
  8. labdoorzone=createColSphere(268.39999389648,1863,7.8,4)
  9. spawnx,spawny,spawnz=213.30000305176,1908.1999511719,17.3
  10.  
  11.  
  12.  
  13.  
  14. function openblastdoors()
  15.     moveObject(blastdoor1,5000,219.95,1875.5999755859,13.89999961853)
  16.     moveObject(blastdoor2,5000,207.9,1875.6,13.89999961853)
  17. end
  18.  
  19. function closeblastdoors()
  20.     moveObject(blastdoor1,5000,215.69999694824,1875.5999755859,13.89999961853)
  21.     moveObject(blastdoor2,5000,211.69999694824,1875.5999755859,13.89999961853)
  22. end
  23.  
  24. function openlabdoor()
  25.     moveObject(labdoor,5000,264.6,1863.8994140625,7)
  26. end
  27.  
  28. function closelabdoor()
  29.     moveObject(labdoor,5000,268.69921875,1863.8994140625,7)
  30. end
  31.  
  32. function openjetdoor()
  33.     moveObject(jetdoor,7000,268.7,1893,16)
  34.     setTimer(liftoff,7000,1)
  35. end
  36.  
  37. function liftoff()
  38.     flare=createObject(354,268.7,1884.2,-31.1)
  39.     moveObject(flare,10000,268.7,1884.2,44)
  40.     moveObject(rocket,10000,268.6,1883.8000488281,60)
  41.     setTimer(spacego,10000,1)
  42. end
  43.  
  44. function spacego()
  45. moveObject(rocket,20000,268.6,1883.8000488281,400)
  46.     moveObject(flare,20000,268.7,1884.2,383)
  47.     setTimer(bye,20000)
  48. end
  49.  
  50. function bye()
  51.     destroyElement(rocket)
  52.     destroyElement(flare)
  53.     setTimer(mark,1000)
  54. end
  55.  
  56. function landboom()
  57.     landrocket=createObject(3786,xland,yland,400,0,270,0)
  58.     landflare=createObject(254,xland,yland,417,0,270,0)
  59.     moveObject(landrocket,10000,xland,yland,zland)
  60.     moveObject(landflare,10000,xland,yland,zland+13)
  61.     setTimer(boom,10000)
  62. end
  63.  
  64. function boom()
  65.     setCameraTarget(source,mark)
  66.     destroyElement(landrocket)
  67.     destroyElement(landflare)
  68.     createExplosion(xland,yland,zland,10)
  69.  
  70. end
  71.  
  72. function markit()
  73.     xl,yl,zl=getElementPosition(source)
  74.     mark=createObject(2880,xl,yl,zl)
  75. end
  76.  
  77. function spawn()
  78.     spawnPlayer(source,spawnx,spawny,spawnz)
  79.     fadeCamera(source,true)
  80.     setCameraTarget(source,source)
  81. end
  82.  
  83. addEventHandler("onColShapeHit",blastdoorzone,openblastdoors)
  84. addEventHandler("onColShapeLeave",blastdoorzone,closeblastdoors)
  85. addEventHandler("onColShapeHit",labdoorzone,openlabdoor)
  86. addEventHandler("onColShapeLeave",labdoorzone,closelabdoor)
  87. addEventHandler("onPlayerJoin", getRootElement(),spawn)
  88. addCommandHandler("launch",openjetdoor)
  89. addCommandHandler("mark",markit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement