Guest User

Capture the Flag script

a guest
Jan 30th, 2013
788
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.52 KB | None | 0 0
  1. variables:
  2. {ctf.%player%.active}=0
  3. {ctf.%player%.team}=1 #2 is red, 3 is blue
  4. {ctf.red.players}=0
  5. {ctf.blue.players}=0
  6. {ctf.red.hasflag}=0
  7. {ctf.blue.hasflag}=0
  8. {ctf.game.open}=0
  9. {ctf.red.taken}=0
  10. {ctf.blue.taken}=0
  11. command /ctf:
  12. trigger:
  13. broadcast "Capture the Flag game starting now! Type /ctfjoin to join!"
  14. set {ctf.game.open} to 1
  15. command /reset:
  16. trigger:
  17. set {ctf.red.players} to 0
  18. set {ctf.blue.players} to 0
  19. set {ctf.red.taken} to 0
  20. set {ctf.blue.taken} to 0
  21. command /ctfjoin:
  22. trigger:
  23. broadcast "Someone just joined the CTF game going on!"
  24. set {ctf.%player%.active} to 1
  25. if {ctf.blue.players} is less than {ctf.red.players}:
  26. send "You are on the BLUE team." to player
  27. make player execute command "/mvtp ctfstuff"
  28. add 1 to {ctf.blue.players}
  29. set {ctf.%player%.team} to 3
  30. if {ctf.blue.players} is more than {ctf.red.players}:
  31. send "You are on the RED team." to player
  32. make player execute command "/mvtp ctfstuff"
  33. add 1 to {ctf.red.players}
  34. set {ctf.%player%.team} to 2
  35. if {ctf.blue.players} is equal to {ctf.red.players}:
  36. chance of 50%:
  37. send "You are on the RED team." to player
  38. make player execute command "/mvtp ctfstuff"
  39. add 1 to {ctf.red.players}
  40. set {ctf.%player%.team} to 2
  41. else:
  42. send "You are on the BLUE team." to player
  43. make player execute command "/mvtp ctfstuff"
  44. add 1 to {ctf.blue.players}
  45. set {ctf.%player%.team} to 3
  46. make player execute command "/mvconfirm"
  47. give 1 282 to the player
  48. give 1 282 to the player
  49. give 1 282 to the player
  50. give 1 282 to the player
  51. give 1 276 to the player
  52. give 1 261 to the player
  53. equip the player with 306
  54. equip the player with 307
  55. equip the player with 308
  56. equip the player with 309
  57. give 1 257 to the player
  58. command /ctfleave:
  59. trigger:
  60. broadcast "Someone just left the CTF game!"
  61. set {ctf.%player%.active} to 0
  62. if {ctf.%player%.team} is equal to 3:
  63. set {ctf.%player%.team} to 1
  64. add -1 to {ctf.blue.players}
  65. else:
  66. set {ctf.%player%.team} to 1
  67. add -1 to {ctf.red.players}
  68. if {ctf.red.hasflag} is equal to player:
  69. set {ctf.red.hasflag} to 0
  70. broadcast "%player% no longer has the Red team's flag!"
  71. if {ctf.blue.hasflag} is equal to player:
  72. set {ctf.blue.hasflag} to 0
  73. broadcast "%player% no longer has the Blue team's flag!"
  74. clear the player's inventory
  75. make player execute command "/spawn"
  76.  
  77. command /triggerwinblue <player>:
  78. executable by: console
  79. trigger:
  80. broadcast "THIS IS A TEST"
  81. if {ctf.red.hasflag} is equal to player:
  82. equip the player with 306
  83. if {ctf.%player%.team} is equal to 3:
  84. broadcast "Blue wins this game!"
  85. loop all players:
  86. if {ctf.%loop-player%.active} is equal to 1:
  87. if {ctf.%loop-player%.team} is equal to 3:
  88. add 90 to {karma.%player%.combat}
  89. else:
  90. add -20 to {karma.%loop-player%.combat}
  91. make loop-player execute command "/ci"
  92. make loop-player execute command "/spawn"
  93. set {ctf.%loop-player%.active} to 0
  94. set {ctf.%loop-player%.team} to 1
  95. set {ctf.game.open} to 0
  96. set {ctf.red.players} to 0
  97. set {ctf.blue.players} to 0
  98. set {ctf.red.taken} to 0
  99. set {ctf.blue.taken} to 0
  100. command /triggerwinred <player>:
  101. executable by: console
  102. trigger:
  103. broadcast "THIS IS A TEST"
  104. if {ctf.blue.hasflag} is equal to player:
  105. equip player with 306
  106. if {ctf.%player%.team} is equal to 2:
  107. broadcast "Red wins this game!"
  108. loop all players:
  109. if {ctf.%loop-player%.active} is equal to 1:
  110. if {ctf.%loop-player%.team} is equal to 2:
  111. add 90 to {karma.%player%.combat}
  112. else:
  113. add -20 to {karma.%player%.combat}
  114. make loop-player execute command "/ci"
  115. make loop-player execute command "/spawn"
  116. set {ctf.%loop-player%.active} to 0
  117. set {ctf.%loop-player%.team} to 1
  118. set {ctf.game.open} to 0
  119. set {ctf.red.players} to 0
  120. set {ctf.blue.players} to 0
  121. set {ctf.red.taken} to 0
  122. set {ctf.blue.taken} to 0
  123. on break of 87:
  124. if {ctf.%player%.active} is equal to 1:
  125. if {ctf.red.taken} is equal to 1:
  126. cancel event
  127. exit trigger
  128. if {ctf.%player%.team} is equal to 3:
  129. broadcast "%player% is carrying the Red team's flag!"
  130. set {ctf.red.hasflag} to player
  131. set {ctf.red.taken} to 1
  132. set player's helmet to 73
  133. cancel event
  134.  
  135. on break of 21:
  136. if {ctf.%player%.active} is equal to 1:
  137. if {ctf.blue.taken} is equal to 1:
  138. cancel event
  139. exit trigger
  140. if {ctf.%player%.team} is equal to 2:
  141. broadcast "%player% is carrying the Blue team's flag!"
  142. set player's helmet to 21
  143. set {ctf.blue.hasflag} to player
  144. set {ctf.blue.taken} to 1
  145. cancel event
  146.  
  147.  
  148.  
  149.  
  150. on death of player:
  151. if {ctf.%player%.active} is equal to 1:
  152. clear drops
  153. make player execute command "/mvtp ctfstuff"
  154. if {ctf.red.hasflag} is equal to player:
  155. set {ctf.red.hasflag} to 0
  156. set {ctf.red.taken} to 0
  157. if {ctf.blue.hasflag} is equal to player:
  158. set {ctf.blue.hasflag} to 0
  159. set {ctf.blue.taken} to 0
  160.  
  161.  
  162. on break of 22:
  163. if {ctf.%player%.active} is equal to 1:
  164. cancel event
  165. on break of 87:
  166. if {ctf.%player%.active} is equal to 1:
  167. cancel event
  168.  
  169. on break of 1:
  170. if {ctf.%player%.active} is equal to 1:
  171. cancel event
  172.  
  173. on break of 89:
  174. if {ctf.%player%.active} is equal to 1:
  175. cancel event
  176. on break of 65:
  177. if {ctf.%player%.active} is equal to 1:
  178. cancel event
  179.  
  180. command /jump:
  181. trigger:
  182. if {ctf.%player%.active} is equal to 0:
  183. teleport player to targeted block
Advertisement
Comments
Add Comment
Please, Sign In to add comment