Guest User

Skript: finished Hunger Games

a guest
Nov 9th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 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!"
  14. set {hg.game.open} to 0 #The game is open for joining
  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: # EDITED THIS PART - LILAZNNIGHT
  31. victim is a player
  32. if {hg.%victim%.hasjoined} is equal to 0: #If they joined
  33. set {hg.%victim%.hasjoined} to 1 #That player died and is out of the game!
  34. add -1 to {hg.game.playersinworld} #Updates variables
  35. add -1 to {hg.current.peoplejoined}
  36. create explosion of force 4 at player #Cannonfire. LOL
  37. kick the victim on account of "You Died!" #I know, kinda cruel.
  38. if {hg.game.playersinworld} is less than 2:
  39. broadcast "We have a winner for the Hunger Games!"
  40. loop players: # Fixed some stuffs here on.
  41. if {hg.%player%.hasjoined} is equal to 0: #WINNER! still in the game!
  42. message "You won!" to the player
  43. give 2 gold ingots to the player #reward,there had to be some...
  44. make player execute command "/back"
  45. else:
  46. clear the inventory of all players# What? If there was no punishment people would spam /hungergames and become super rich.
  47. wait 2 ticks
  48. set {hg.%player%.hasjoined} to 1
  49. set {hg.current.peoplejoined} to 0
  50. set {hg.game.playersinworld} to 0
  51. broadcast "Game over. If you didn't win, better luck next time."
  52.  
  53. command /join:
  54. executable by: players
  55. trigger:
  56. if {hg.game.open} is more than 0: #You can only join an existiing game!
  57. message "There isn't a Hunger Games going on!"
  58. exit
  59. message "You just joined the Hunger Games! May the odds be ever in your favor."
  60. set {hg.%player%.hasjoined} to 0
  61. add 1 to {hg.game.playersinworld}
Advertisement
Add Comment
Please, Sign In to add comment