Advertisement
Guest User

Hunger Games for Skript

a guest
Nov 7th, 2012
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. variables:
  2. {hg.%player%.hasjoined} = 1 #1 if false, 0 if true
  3. {hg.current.peoplejoined} = 0 #How many people in the game
  4. {hg.game.open} = 1 #1 if false, 0 if true
  5. {hg.game.playersinworld} = 0
  6.  
  7. on weather change:
  8. cancel event
  9.  
  10. command /hungergames:
  11. executable by: players
  12. trigger:
  13. broadcast "Hunger games starting in 2 minutes! Type /join to join!" #Broadcasts the game(i lost the game)
  14. set {hg.game.open} to 0 #The game is open for playing
  15. wait 2 minutes #2 minutes until start
  16. loop players in world:
  17. if {hg.%player%.hasjoined} is less than 1:
  18. add 1 to {hg.current.peoplejoined} #See how many people have joined
  19. if {hg.current.peoplejoined} is less than 2:
  20. message "Game canceled. At least 2 people need to join." #You can't have a 1-player Hunger Games!
  21. exit
  22. loop players in world:
  23. if {hg.%player%.hasjoined} is less than 1:
  24. make player execute command "/warp hungergamesspawn" #TP them to the same spot
  25. set {hg.game.open} to 1 #The game is now closed!
  26. disable pvp #No one can attack anyone for 2 minutes
  27. broadcast "Everyone is invincible for 2 minutes. Go!"
  28. wait 2 minutes
  29. enable pvp #DUN DUN DUN
  30. on death of player:
  31. set {hg.%player%.hasjoined} to 1 #That player died.
  32. add -1 to {hg.game.playersinworld} #Updates variables
  33. add -1 to {hg.current.peoplejoined}
  34. create explosion of force 4 at player #Cannonfire, mwahaha
  35. kick the player on account of "You Died!" #I know, kinda cruel.
  36. if {hg.game.playersinworld} is less than 2: #Checks for a winner
  37. broadcast "We have a winner for the Hunger Games!"
  38. loop players:
  39. if {hg.%player%.hasjoined} is less than 1: #WINNER!
  40. message "You won!"
  41. give 2 gold ingots to the player #reward
  42. else:
  43. clear the player's inventory #VERY cruel.
  44. loop players:
  45. set {hg.%player%.hasjoined} to 1
  46. set {hg.current.peoplejoined} to 0
  47. set {hg.game.playersinworld} to 0
  48. broadcast "Game over. If you didn't win, better luck next time."
  49. command /join:
  50. executable by: players
  51. trigger:
  52. if {hg.game.open} is more than 0: #You can only join an existiing game!
  53. message "There isn't a Hunger Games going on!"
  54. exit
  55. message "You just joined the Hunger Games!"
  56. set {hg.%player%.hasjoined} to 0 #May the odds be ever in your favor.
  57. add 1 to {hg.game.playersinworld}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement