MostFunGuy

MFG's Cannons

Dec 12th, 2013
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. #
  2. # MFG's Skript to Create usable cannons!
  3. #
  4. #
  5.  
  6. on click on dispenser:
  7. player's tool is gunpowder:
  8. line 1 of block behind block contains "[CANNON]":
  9. cancel event
  10. line 2 of block behind block contains "READY" or "NEEDS":
  11. if line 4 of block behind block is not set:
  12. set line 4 of block behind block to "<red>0"
  13. if number of gunpowder in the block's inventory is more than 4:
  14. message "<green>[CANNON]<yellow> Dude this cannon is already full!" to player
  15. stop
  16. #set {_line4} to 0
  17. #add uncoloured line 4 of block behind block to {_line4}
  18. #set {_line4} to {_line4} + 1
  19. add a gunpowder to the block's inventory
  20. remove 1 gunpowder from the player's tool
  21. set line 4 of block behind block to "<green>%number of gunpowder in the block's inventory%"
  22. stop
  23. player's tool is flint and steel:
  24. line 1 of block behind block contains "[CANNON]":
  25. cancel event
  26. line 2 of block behind block contains "READY" or "NEEDS":
  27. if line 4 of block behind block does not contain "0":
  28. set {_line4} to uncoloured line 4 of block behind block
  29. set {_facing} to the block's facing
  30. set {_inverse} to the block behind the block's facing
  31. play effect "smoke" at the block above the block's location
  32. play effect "active furnace" at the block above the block's location
  33. play "fireworks_launch" at the clicked block
  34. play "GHAST_FIREBALL" at the clicked block
  35.  
  36. spawn a primed tnt in front of the block
  37.  
  38. if number of gunpowder in the block is 1:
  39. push the last spawned entity upwards at speed .2
  40. push the last spawned entity {_facing} at speed .5
  41. if number of gunpowder in the block is 2:
  42. push the last spawned entity upwards at speed .2
  43. push the last spawned entity {_facing} at speed .75
  44. if number of gunpowder in the block is 3:
  45. push the last spawned entity upwards at speed .2
  46. push the last spawned entity {_facing} at speed 1
  47. if number of gunpowder in the block is 4:
  48. push the last spawned entity upwards at speed .2
  49. push the last spawned entity {_facing} at speed 1.25
  50. if number of gunpowder in the block is more than 4:
  51. push the last spawned entity upwards at speed .2
  52. push the last spawned entity {_facing} at speed 1.75
  53. remove all gunpowder from the block's inventory
  54. set line 4 of block behind block to "<red>0"
  55. set line 2 of block behind block to "<yellow>RELOADING"
  56. wait 1 second
  57. set {_safeloop} to 0
  58. set {_testboom} to false
  59. while {_testboom} is false :
  60. add 1 to {_safeloop}
  61. if {_safeloop} is more than 15:
  62. stop
  63. message "looping" to all players
  64. loop blocks in radius 2 around the last spawned entity:
  65. if loop-block is not air:
  66. if {_loc} is not set:
  67. set {_loc} to the loop-block's location
  68. message "setsetset" to player
  69. set {_testboom} to true
  70. message "This is when it will boom" to all players
  71. make an explosion of force 5 at {_loc}
  72. make a fake explosion at {_loc}
  73. teleport the last spawned entity to location 0, 0, 50000 of the last spawned entity's world
  74. exit 2 sections
  75. wait 3 ticks
  76.  
  77. wait 5 seconds
  78.  
  79. set line 2 of block behind block to "<green>Needs Powder!"
  80.  
  81. on projectile hit:
  82. stop
  83. #message "It hit" to all players
  84.  
  85. command /tt:
  86. trigger:
  87. stop
  88. #show "s;5;i;stone;c;say hi;l;TEST LORE||multiline||&cColor;n;&6HI!;s;9;i;20 grass;c;stop" with 1 rows named "OVEN!" to player
  89.  
  90.  
  91.  
  92.  
  93.  
  94. on shoot:
  95. while projectile exists:
  96. loop entities in radius 5 of projectile:
  97. loop-entity is not shooter:
  98. loop-entity is not a arrow:
  99. make projectile home towards loop-entity
  100. wait 4 tick
Advertisement
Add Comment
Please, Sign In to add comment