CREAMPAN0408

Untitled

Feb 23rd, 2019
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.12 KB | None | 0 0
  1. options:
  2. spawn: 706.5, 31.5, -7.5
  3. world: CTF2
  4. maps: 2
  5. gamenumber: 1
  6.  
  7. on load:
  8. delete {gamecoords::*}
  9. #MAP COORDS
  10.  
  11. #!map 1 - flower map
  12.  
  13. #blue
  14. set {gamecoords::bflag1} to location at 95, 58.5, 711.5 of "{@world}"
  15. set {gamecoords::bset1} to "/setblock 95 58 711 minecraft:wall_banner 9 false {Base:4}"
  16. set {gamecoords::bspawn1} to location at 65.5, 61.5, 704.5 of "{@world}"
  17.  
  18. #red
  19. set {gamecoords::rflag1} to location at 36.5, 56.5, 883.5 of "{@world}"
  20. set {gamecoords::rset1} to "/setblock 36 56 883 minecraft:wall_banner 1 false {Base:1}"
  21. set {gamecoords::rspawn1} to location at 67.5, 57.5, 883.5 of "{@world}"
  22.  
  23.  
  24. #!map 2 - mushroom map
  25.  
  26. #blue
  27. set {gamecoords::bflag2} to location at -660.5, 50.5, 77.5 of "{@world}"
  28. set {gamecoords::bset2} to "/setblock -661 50 77 minecraft:wall_banner 9 false {Base:4}"
  29. set {gamecoords::bspawn2} to location at -660.5, 40.5, 76.5 of "{@world}"
  30.  
  31. #red
  32. set {gamecoords::rflag2} to location at -686.5, 50.5, -50.5 of "{@world}"
  33. set {gamecoords::rset2} to "/setblock -687 50 -51 minecraft:wall_banner 2 false {Base:1}"
  34. set {gamecoords::rspawn2} to location at -686.5, 40.5, -49.5 of "{@world}"
  35.  
  36. function resetSide(color: text):
  37. if {_color} is "red":
  38. command "%{gamecoords::rset%{game::map}%}%"
  39. else if {_color} is "blue":
  40. command "%{gamecoords::bset%{game::map}%}%"
  41.  
  42. function randomMap(b: boolean = true):
  43. set {game::map} to a random integer between 1 and {@maps}
  44. command "%{gamecoords::rset%{game::map}%}%"
  45. command "%{gamecoords::bset%{game::map}%}%"
  46.  
  47. function getState(b: boolean = true) :: integer:
  48. return value of sql var "game::ctf{@gamenumber}::state" parsed as integer
  49.  
  50. function getPlays(p: offlineplayer) :: integer:
  51. return value of sql var "stats::ctf::gamesplayed::%{_p}%" parsed as integer
  52.  
  53. function tpLoc(p: player):
  54. set {_p}'s level to 0
  55. clear {_p}'s inventory
  56. if getState() is 3:
  57. evaluate "loadKit({_p})"
  58. if {game::team::%{_p}%} is "red":
  59. set {_loc} to {gamecoords::rspawn%{game::map}%}
  60. teleport {_p} to {_loc}
  61. set {_p} tab name to "&c%{_p}%"
  62. set {_p}'s helmet to a red wool
  63. else if {game::team::%{_p}%} is "blue":
  64. set {_loc} to {gamecoords::bspawn%{game::map}%}
  65. teleport {_p} to {_loc}
  66. set {_p} tab name to "&9%{_p}%"
  67. set {_p}'s helmet to a blue wool
  68. else:
  69. teleport {_p} to location at {@spawn} of the world "{@world}"
  70. set slot 2 of {_p} to a clock named "&7Team Selector"
  71. set slot 6 of {_p} to a gunpowder named "&7Kit Selector"
  72. if {game::multiplier} is not set:
  73. set slot 4 of {_p} to a glowing gold ingot named "&7Multipliers"
  74.  
  75. on spawn:
  76. cancel the event
  77.  
  78. on xp spawn:
  79. cancel the event
  80.  
  81. on hunger meter change:
  82. cancel the event
  83.  
  84. on skript load:
  85. delete {game::*}
  86. set sql var "game::ctf{@gamenumber}::state" to "1"
  87. set {game::nodamage} to true
  88. while true:
  89. wait 1 second
  90. if {game::time} is set:
  91. difference between {game::time} and now is greater than 30 seconds
  92. delete {game::time}
  93. getState() is 2
  94. set sql var "game::ctf{@gamenumber}::state" to "3"
  95. delete {game::nodamage}
  96. randomMap()
  97. loop all players:
  98. if {game::team::%loop-player%} is not set:
  99. if size of {game::blue::*} is less than size of {game::red::*}:
  100. set {game::team::%loop-player%} to "blue"
  101. set {game::blue::%loop-player%} to loop-player
  102. else:
  103. set {game::team::%loop-player%} to "red"
  104. set {game::red::%loop-player%} to loop-player
  105. tpLoc(loop-player)
  106. set sql var "stats::ctf::gamesplayed::%loop-player%" to "%getPlays(loop-player) + 1%"
  107. if getState() is 1:
  108. loop all players:
  109. set loop-player's action bar to "&7Need at least &e%4 - amount of players%&7 more players to start!"
  110. else if getState() is 2:
  111. loop all players:
  112. set {_time} to difference between {game::time} and now
  113. set {_time} to "%difference between {_time} and 30 second%"
  114. set {_time::*} to {_time} split at "."
  115. set {_time} to {_time::1} parsed as integer
  116. set loop-player's level to {_time}
  117. set loop-player's action bar to "&7Starting in &e%{_time}% seconds"
  118. command "/playsound random.click %loop-player% ~ ~ ~ 1 0.5 1"
  119. else if getState() is 3:
  120. wait 1 tick
  121.  
  122. on right click on wall_banner or standing_banner:
  123. {game::nodamage} is not set
  124. player's gamemode is not spectator
  125. set {_team} to {game::team::%player%}
  126. set {_redflag} to {gamecoords::rflag%{game::map}%}
  127. set {_blueflag} to {gamecoords::bflag%{game::map}%}
  128. set {_loc} to {_%{_team}%flag}
  129. if "%nbt of clicked block%" contains "Base:1":
  130. if {_team} is "red":
  131. distance between {_loc} and clicked block is greater than 1
  132. broadcast "&c%player%&7 has returned the flag to the &cRed Base"
  133. resetSide("red")
  134. set clicked block to air
  135. else:
  136. set {_name} to "&cRed Flag"
  137. set {_item} to banner:1
  138. broadcast "&9%player%&7 is capturing the &cRed Flag"
  139. $ thread
  140. addCoins(player, 25)
  141. else:
  142. if {_team} is "blue":
  143. distance between {_loc} and clicked block is greater than 1
  144. broadcast "&9%player%&7 has returned the flag to the &9Blue Base"
  145. resetSide("blue")
  146. set clicked block to air
  147. else:
  148. set {_name} to "&9Blue Flag"
  149. set {_item} to a banner:4
  150. broadcast "&c%player%&7 is capturing the &9Blue Flag"
  151. $ thread
  152. addCoins(player, 25)
  153. {_name} is set
  154. if {game::capture::%player%} is not set:
  155. set clicked block to air
  156. set {game::capture::%player%} to {_name}
  157. set {game::contents::%player%} to serialized contents of player's inventory
  158. set {game::slot::%player%} to player's current hotbar slot
  159. loop 36 times:
  160. set slot loop-number - 1 of player to air
  161. set player's helmet to {_item} named {_name}
  162. set slot 4 of player to {_item} named {_name}
  163. set player's current hotbar slot to 4
  164. while {game::capture::%player%} is set:
  165. "%{game::capture::%player%}%" is not "<none>"
  166. set player's action bar to "&7Capturing &7the %{_name}%! &7Return it to your base to capture it!"
  167. set player's current hotbar slot to 4
  168. wait 5 ticks
  169.  
  170. on join:
  171. set join message to ""
  172. heal player
  173. set player's gamemode to adventure
  174. tpLoc(player)
  175. if amount of players is less than 4:
  176. set sql var "game::ctf{@gamenumber}::state" to "1"
  177. delete {game::time}
  178. else if amount of players is greater than or equal to 4:
  179. getState() is not 2 or 3
  180. set sql var "game::ctf{@gamenumber}::state" to "2"
  181. set {game::time} to now
  182. wipe player's sidebar
  183. set name of sidebar of player to "&c&lCTF"
  184. set id score "&7PLAYERS" in sidebar of player to 8 with id "Players.%player%"
  185. set id score "&e%amount of players%/16" in sidebar of player to 7 with id "PlayerCount.%player%"
  186. set id score " " in sidebar of player to 6 with id "Space1.%player%"
  187. set id score "&9BLUE" in sidebar of player to 5 with id "Blue.%player%"
  188. set id score "&e%size of {game::blue::*}%" in sidebar of player to 4 with id "BlueCount.%player%"
  189. set id score "&cRED" in sidebar of player to 3 with id "Red.%player%"
  190. set id score "&e&e%size of {game::red::*}%" in sidebar of player to 2 with id "RedCount.%player%"
  191. set id score " " in sidebar of player to 1 with id "Space2.%player%"
  192. set id score "&ewww.minealot.net" in sidebar of player to 0 with id "Website.%player%"
  193. while sidebar name for player contains "CTF":
  194. wait 15 tick
  195. if player is not online:
  196. stop loop
  197. if sidebar name for player is "&c&lCTF":
  198. set name of sidebar of player to "&9&lCTF"
  199. else:
  200. set name of sidebar of player to "&c&lCTF"
  201. update score id "PlayerCount.%player%" to "&e%amount of players%/16" and 7
  202. update score id "BlueCount.%player%" to "&e%size of {game::blue::*}%" and 4
  203. update score id "RedCount.%player%" to "&e&e%size of {game::red::*}%" and 2
  204.  
  205. on quit:
  206. delete {game::team::%player%}
  207. delete {game::blue::%player%}
  208. delete {game::red::%player%}
  209. if getState() is 3:
  210. kill player
  211. else if getState() is 1 or 2:
  212. if size of {game::blue::*} is greater than ceil(amount of players/2):
  213. while size of {game::blue::*} is greater than ceil(amount of players/2):
  214. set {_p} to a random element out of {game::blue::*}
  215. delete {game::team::%{_p}%}
  216. delete {game::blue::%{_p}%}
  217. else if size of {game::red::*} is greater than floor(amount of players/2):
  218. while size of {game::floor::*} is greater than floor(amount of players/2):
  219. set {_p} to a random element out of {game::floor::*}
  220. delete {game::floor::%{_p}%}
  221. delete {game::floor::%{_p}%}
  222. if amount of players is less than 4:
  223. set sql var "game::ctf{@gamenumber}::state" to "1"
  224. delete {game::time}
  225. wait 1 tick
  226. getState() is 3
  227. if size of {game::blue::*} is 0:
  228. set {_end} to true
  229. else if size of {game::red::*} is 0:
  230. set {_end} to true
  231. if {_end} is true:
  232. if {game::captures::red} is greater than {game::captures::blue}:
  233. loop all players:
  234. send loop-player title "&7The &c&lred&7 team has won!" for 5 seconds
  235. else if {game::captures::blue} is greater than {game::captures::red}:
  236. loop all players:
  237. send loop-player title "&7The &9&lblue&7 team has won!" for 5 seconds
  238. else:
  239. loop all players:
  240. send loop-player title "&7The game has ended in a tie!" for 5 seconds
  241. loop 10 times:
  242. loop all players:
  243. if loop-number is 1:
  244. {game::team::%loop-player%} is {_team}
  245. set {_wins} to value of sql var "stats::ctf::wins::%loop-player%" parsed as integer
  246. set sql var "stats::ctf::wins::%loop-player%" to "%{_wins} + 1%"
  247. command "/playsound fireworks.launch %loop-player% ~ ~ ~ 1 1 1"
  248. wait 10 ticks
  249. loop all players:
  250. send loop-player to "lobby1"#"lobby1-ctf"
  251. delete {game::*}
  252. set sql var "game::ctf{@gamenumber}::state" to "0"
  253. wait 10 seconds
  254. command "/stop"
  255.  
  256. on drop:
  257. cancel the event
  258.  
  259. on right click on a gold block:
  260. player's gamemode is not spectator
  261. {game::nodamage} is not set
  262. set {_team} to {game::team::%player%}
  263. {game::capture::%player%} is set
  264. set {_redflag} to {gamecoords::rflag%{game::map}%}
  265. set {_blueflag} to {gamecoords::bflag%{game::map}%}
  266. set {_loc} to {_%{_team}%flag}
  267. distance between player and {_loc} is less than 7
  268. add 1 to {game::captures::%{_team}%}
  269. broadcast "&e%player%&7 has captured &7the %{game::capture::%player%}% &7&o(%{game::captures::%{_team}%}%/3 captures for the %{_team}% team)"
  270. $ thread
  271. addCoins(player, 75)
  272. if {game::captures::%{_team}%} is greater than 3:
  273. set {game::captures::%{_team}%} to 0
  274. if {game::captures::%{_team}%} is 3:
  275. set {game::nodamage} to true
  276. if {game::captures::red} is greater than {game::captures::blue}:
  277. loop all players:
  278. send loop-player title "&7The &c&lred&7 team has won!" for 5 seconds
  279. else if {game::captures::blue} is greater than {game::captures::red}:
  280. loop all players:
  281. send loop-player title "&7The &9&lblue&7 team has won!" for 5 seconds
  282. loop 10 times:
  283. loop all players:
  284. if loop-number is 1:
  285. {game::team::%loop-player%} is {_team}
  286. set {_wins} to value of sql var "stats::ctf::wins::%loop-player%" parsed as integer
  287. set sql var "stats::ctf::wins::%loop-player%" to "%{_wins} + 1%"
  288. command "/playsound fireworks.launch %loop-player% ~ ~ ~ 1 1 1"
  289. wait 10 ticks
  290. loop all players:
  291. send loop-player to "lobby1"#"lobby1-ctf"
  292. delete {game::*}
  293. set sql var "game::ctf{@gamenumber}::state" to "0"
  294. wait 10 seconds
  295. command "/stop"
  296. if {_team} is "red":
  297. resetSide("blue")
  298. set player's helmet to a red wool
  299. else if {_team} is "blue":
  300. resetSide("red")
  301. set player's helmet to a blue wool
  302. restore inventory of player from {game::contents::%player%}
  303. set player's current hotbar slot to {game::slot::%player%}
  304. delete {game::capture::%player%}
  305. delete {game::contents::%player%}
  306. delete {game::slot::%player%}
  307.  
  308. on right click holding a clock:
  309. name of player's tool is "&7Team Selector"
  310. cancel the event
  311. open chest with 1 row named "&7Team Selector" to player
  312. wait 1 tick
  313. while inventory name of player's current inventory is "&7Team Selector":
  314. set slot 2 of player's current inventory to a blue wool named "&9Blue:&e %size of {game::blue::*}%/%ceil(amount of players/2)%"
  315. set slot 6 of player's current inventory to a red wool named "&cRed:&e %size of {game::red::*}%/%ceil(amount of players/2)%"
  316. wait 2 ticks
  317.  
  318. on inventory click:
  319. cancel the event
  320. if inventory name of player's current inventory is "&7Team Selector":
  321. if clicked item is a blue wool:
  322. size of {game::blue::*} is not ceil(amount of players/2)
  323. set {game::blue::%player%} to player
  324. set {game::team::%player%} to "blue"
  325. delete {game::red::%player%}
  326. send "&9You have joined the blue team"
  327. else if clicked item is a red wool:
  328. size of {game::red::*} is not ceil(amount of players/2)
  329. set {game::red::%player%} to player
  330. set {game::team::%player%} to "red"
  331. delete {game::blue::%player%}
  332. send "&cYou have joined the red team"
  333.  
  334. on gamemode change:
  335. player's gamemode is not adventure or spectator
  336. set player's gamemode to adventure
  337.  
  338. on skript stop:
  339. delete {game::*}
  340.  
  341. on skript load:
  342. command "/save-off"
  343.  
  344. on break:
  345. cancel the event
  346.  
  347. on place:
  348. cancel the event
  349.  
  350. on form:
  351. cancel the event
  352.  
  353. on projectile hit:
  354. wait 15 seconds
  355. delete projectile
  356.  
  357. on damage of a player:
  358. if {game::nodamage} is true:
  359. cancel the event
  360. else if attacker's helmet is a banner:
  361. cancel the event
  362. else if {game::team::%victim%} is {game::team::%attacker%}:
  363. cancel the event
  364. else if damage cause is fall:
  365. set damage to damage*0.66
  366. else if damage cause is void:
  367. if victim's gamemode is spectator:
  368. teleport victim to location 100 above victim
  369. else:
  370. kill victim
  371.  
  372. on death of a player:
  373. set death message to ""
  374. clear drops
  375. getState() is 3
  376. set {_deaths} to value of sql var "stats::ctf::deaths::%victim%" parsed as integer
  377. set sql var "stats::ctf::deaths::%victim%" to "%{_deaths} + 1%"
  378. if {game::capture::%victim%} is set:
  379. if y-coordinate of victim is less than 0:
  380. broadcast "&7%victim% died while carrying &7the %{game::capture::%player%}%"
  381. broadcast "&7The flag has been returned because &a%victim%&7 has died in the void!"
  382. if {game::capture::%victim%} is "&cRed Flag":
  383. resetSide("red")
  384. else:
  385. resetSide("blue")
  386. else:
  387. if "%horizontal facing of victim%" is "east":
  388. set {_data} to 12
  389. else if "%horizontal facing of victim%" is "north":
  390. set {_data} to 8
  391. else if "%horizontal facing of victim%" is "west":
  392. set {_data} to 4
  393. else:
  394. set {_data} to 0
  395. if {game::capture::%victim%} is "&cRed Flag":
  396. broadcast "&9%victim% died while carrying &7the %{game::capture::%player%}%"
  397. command "/setblock %floor(victim's x-coordinate)% %floor(victim's y-coordinate)% %floor(victim's z-coordinate)% minecraft:standing_banner %{_data}% false {Base:1}"
  398. else:
  399. broadcast "&c%victim% died while carrying &7the %{game::capture::%player%}%"
  400. command "/setblock %floor(victim's x-coordinate)% %floor(victim's y-coordinate)% %floor(victim's z-coordinate)% minecraft:standing_banner %{_data}% false {Base:4}"
  401. broadcast "&7Death coordinates: %floor(x-coordinate of victim)%, %floor(y-coordinate of victim)%, %floor(z-coordinate of victim)%"
  402. if attacker is a player:
  403. if {game::team::%victim%} is "red":
  404. send "&7You killed &c%victim%" to attacker
  405. send "&9%attacker%&7 killed you" to victim
  406. else:
  407. send "&7You killed &9%victim%" to attacker
  408. send "&c%attacker%&7 killed you" to victim
  409. heal attacker by 2.5 hearts
  410. apply regeneration 2 to attacker for 5 seconds
  411. command "/playsound note.harp %attacker% ~ ~ ~ 1 1 1"
  412. $ thread
  413. addCoins(attacker, 15)
  414. $ thread
  415. set {_kills} to value of sql var "stats::ctf::kills::%attacker%" parsed as integer
  416. $ thread
  417. set sql var "stats::ctf::kills::%attacker%" to "%{_kills} + 1%"
  418. delete {game::capture::%victim%}
  419. add 0.34 to {game::respawn::%victim%}
  420. set {_loc} to location at victim
  421. wait 5 ticks
  422. force respawn victim
  423. wait 1 tick
  424. clear player's inventory
  425. set victim's gamemode to spectator
  426. hide victim from all players
  427. wait 1 tick
  428. teleport victim to {_loc}
  429. wait 10 ticks
  430. loop 4 + floor({game::respawn::%victim%}) times:
  431. set victim's action bar to "&7&lRESPAWNING IN &e&l%(5 + floor({game::respawn::%victim%})) - loop-number%"
  432. command "/playsound note.bass %victim% ~ ~ ~ 0.1 0.7 0.1"
  433. loop 20 times:
  434. wait 1 tick
  435. set is flying of victim to true
  436. set victim's gamemode to adventure
  437. reveal victim to all players
  438. tpLoc(victim)
  439.  
  440. on right click holding a gold ingot:
  441. cancel the event
  442. open chest with 1 row named "&7Multipliers" to player
  443. wait 1 tick
  444. set {_2} to value of sql var "multipliers::double::%player%" parsed as integer
  445. set {_3} to value of sql var "multipliers::triple::%player%" parsed as integer
  446. set {_4} to value of sql var "multipliers::quadruple::%player%" parsed as integer
  447. if "%{_2}%" is "<none>" or "0":
  448. set slot 2 of player's current inventory to a gold nugget named "&7Double Coins Multiplier:&e 0"
  449. else:
  450. set slot 2 of player's current inventory to a gold nugget named "&7Double Coins Multiplier:&e %{_2}%" with lore "&7Click to activate double coins multiplier for this game!"
  451. if "%{_3}%" is "<none>" or "0":
  452. set slot 4 of player's current inventory to a gold ingot named "&7Triple Coins Multiplier:&e 0"
  453. else:
  454. set slot 4 of player's current inventory to a gold ingot named "&7Triple Coins Multiplier:&e %{_3}%" with lore "&7Click to activate triple coins multiplier for this game!"
  455. if "%{_4}%" is "<none>" or "0":
  456. set slot 6 of player's current inventory to a gold block named "&7Quadruple Coins Multiplier:&e 0"
  457. else:
  458. set slot 6 of player's current inventory to a gold block named "&7Quadruple Coins Multiplier:&e %{_4}%" with lore "&7Click to activate quadruple coins multiplier for this game!"
  459.  
  460. on inventory click:
  461. cancel the event
  462. inventory name of player's current inventory is "&7Multipliers"
  463. clicked item is not air
  464. set {_2} to value of sql var "multipliers::double::%player%" parsed as integer
  465. set {_3} to value of sql var "multipliers::triple::%player%" parsed as integer
  466. set {_4} to value of sql var "multipliers::quadruple::%player%" parsed as integer
  467. if clicked item is a gold nugget:
  468. if lore of clicked item does not contain "&7Click":
  469. send "&7You have no Double Coins Multiplier to activate"
  470. else:
  471. broadcast "&e%player%&7 has activated a Double Coins Multiplier"
  472. command "/playsound random.levelup @a"
  473. set {game::multiplier} to player
  474. set {game::multiplier::amount} to 2
  475. remove all gold ingot from inventory of all players
  476. set sql var "multipliers::double::%player%" to "%{_2} - 1%"
  477. send "&7You now have &e%{_2} - 1%&7 Double Coins Multiplier left!"
  478. loop all players:
  479. inventory name of loop-player's current inventory is "&7Multipliers"
  480. close loop-player's inventory
  481. else if clicked item is a gold ingot:
  482. if lore of clicked item does not contain "&7Click":
  483. send "&7You have no Triple Coins Multiplier to activate"
  484. else:
  485. broadcast "&e%player%&7 has activated a Triple Coins Multiplier"
  486. command "/playsound random.levelup @a"
  487. set {game::multiplier} to player
  488. set {game::multiplier::amount} to 3
  489. remove all gold ingot from inventory of all players
  490. set sql var "multipliers::triple::%player%" to "%{_3} - 1%"
  491. send "&7You now have &e%{_3} - 1%&7 Triple Coins Multiplier left!"
  492. loop all players:
  493. inventory name of loop-player's current inventory is "&7Multipliers"
  494. close loop-player's inventory
  495. else if clicked item is a gold block:
  496. if lore of clicked item does not contain "&7Click":
  497. send "&7You have no Quadruple Coins Multiplier to activate"
  498. else:
  499. broadcast "&e%player%&7 has activated a Quadruple Coins Multiplier"
  500. command "/playsound random.levelup @a"
  501. set {game::multiplier} to player
  502. set {game::multiplier::amount} to 4
  503. remove all gold ingot from inventory of all players
  504. set sql var "multipliers::quadruple::%player%" to "%{_4} - 1%"
  505. send "&7You now have &e%{_4} - 1%&7 Quadruple Coins Multiplier left!"
  506. loop all players:
  507. inventory name of loop-player's current inventory is "&7Multipliers"
  508. close loop-player's inventory
  509.  
  510. on respawn:
  511. tpLoc(player)
  512.  
  513. on tool change:
  514. {game::capture::%player%} is set
  515. cancel the event
  516. set player's current hotbar slot to 4
  517. wait 1 tick
  518. set player's current hotbar slot to 4
Add Comment
Please, Sign In to add comment