Shooterowy

[SCRIPT] LifeMC

Jul 27th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.22 KB | None | 0 0
  1. #Autor: Shooterowy
  2.  
  3. options:
  4. Initial_Lives: 3 #Poczatkowa ilosc zyc
  5. Max_Lives: 10 #Maksymalna ilosc zyc
  6. Death_Worlds: "world" or "world_nether" #Swiaty w ktorych dziala skrypt. Aby dodac nowy swiat dopisz 'or "swiat"'
  7. Action_Item: ghast tear #Przedmiot, ktory dodaje zycia
  8. Items_per_Life: 3 #Ile przedmiotow trzeba uzyc aby zdobyc 1 zycie.
  9. on connect:
  10. if {LifeMC::lives::%player%} is 0:
  11. kick player due to "&cYou lost all your lives. You cannot join the server."
  12. stop
  13. on join:
  14. wait a tick
  15. if {LifeMC::lives::%player%} is not set:
  16. set {LifeMC::counter::%player%} to 0
  17. set {LifeMC::lives::%player%} to {@Initial_Lives}
  18. send "&a[LifeMC] &bYou have received &c{@Initial_Lives} &blives. Good Luck!"
  19. stop
  20. Send "&a[LifeMc] &bWelcome back, You have &c%{LifeMC::lives::%player%}% &blives left."
  21. if {LifeMC::savior::%player%} is set:
  22. send "&a[LifeMC] &bYou have been revived by &6%{LifeMC::savior::%player%}%&b."
  23. clear {LifeMC::savior::%player%}
  24. stop
  25. on death of player:
  26. if victim is in world {@Death_Worlds}:
  27. wait a tick
  28. remove 1 from {LifeMC::lives::%victim%}
  29. if {LifeMC::lives::%victim%} is not 0:
  30. send "&a[LifeMC] &bYou died and lost a life. You have &c%{LifeMC::lives::%victim%}% &blives left." to victim
  31. stop
  32. set death message to ""
  33. broadcast "&a[LifeMC] &6%victim% &blost all his lives. If you want to revive him type &c""/revive %victim%""&b."
  34. kick victim due to "&cYou lost all your lives."
  35. stop
  36. on rightclick holding {@Action_Item}:
  37. if {LifeMC::lives::%player%} is {@Max_Lives}:
  38. send "&a[LifeMC] &cYou have the maximum amount of lives."
  39. stop
  40. add 1 to {LifeMC::counter::%player%}
  41. remove 1 {@Action_Item} from player
  42. if {LifeMC::counter::%player%} is {@Items_per_Life}:
  43. add 1 to {LifeMC::lives::%player%}
  44. set {LifeMC::counter::%player%} to 0
  45. send "&a[LifeMC] &bYou got an extra life. You have &c%{LifeMC::lives::%player%}% &blives now."
  46. stop
  47. command /revive [<offlineplayer>]:
  48. aliases: ulecz
  49. description: Revives specific player.
  50. trigger:
  51. if player doesn't have the permission "lifemc.revive":
  52. send "&a[LifeMC] &cYou do not have the required permissions."
  53. stop
  54. if arg is not set:
  55. send "&a[LifeMC] &cCorrect usage: &7/revive <player>"
  56. stop
  57. if {LifeMC::lives::%arg%} is not set:
  58. send "&a[LifeMC] &cThe player &6%arg% &cdoes not exist!"
  59. stop
  60. if {LifeMC::lives::%arg%} is more than 0:
  61. send "&a[LifeMC] &cThe player &6%arg% &cdoes not need your help!"
  62. stop
  63. if {LifeMC::lives::%player%} is 1:
  64. send "&a[LifeMC] &cYou have only &c1 life left!"
  65. stop
  66. add 1 to {LifeMC::lives::%arg%}
  67. set {LifeMC::savior::%arg%} to player
  68. remove 1 from {LifeMC::lives::%player%}
  69. send "&a[LifeMC] &bYou revived &6%arg%&b. You have &c%{LifeMC::lives::%player%}% &blives left."
  70. stop
  71. command /lives [<offlineplayer=%player%>]:
  72. aliases: zycia
  73. description: Shows current amount of lives.
  74. trigger:
  75. if player doesn't have the permission "lifemc.lives":
  76. send "&a[LifeMC] &cYou do not have the required permissions."
  77. stop
  78. if {LifeMC::lives::%arg%} is not set:
  79. send "&a[LifeMC] &cThe player &6%arg% &cdoes not exist!"
  80. stop
  81. if arg is "%player%":
  82. send "&a[LifeMC] &bYou have &c%{LifeMC::lives::%arg%}% &blives left."
  83. stop
  84. else:
  85. if player doesn't have the permission "lifemc.lives.other":
  86. send "&a[LifeMC] &cYou do not have the required permissions."
  87. stop
  88. send "&a[LifeMC] &bThe player &6%arg% &bhas &c%{LifeMC::lives::%arg%}% &blives left."
  89. stop
  90.  
  91. command /givelife [<offlineplayer>] [<number>]:
  92. aliases: daj
  93. description: Gives specific amount of life to a specific player.
  94. trigger:
  95. if player doesn't have the permission "lifemc.give":
  96. send "&a[LifeMC] &cYou do not have the required permissions."
  97. stop
  98. if arg 1 is not set:
  99. send "&a[LifeMC] &cCorrect usage: &7/givelife <player> <amount>"
  100. stop
  101. if arg 2 is not set:
  102. send "&a[LifeMC] &cCorrect usage: &7/givelife <player> <amount>"
  103. stop
  104. if {LifeMC::lives::%arg 1%} is not set:
  105. send "&a[LifeMC] &cThe player &6%arg 1% &cdoes not exist!"
  106. stop
  107. add arg 2 to {LifeMC::lives::%arg 1%}
  108. send "&a[LifeMC] &bYou gave &c%arg 2% &blives to the player &6%arg 1%&b. He has &c%{LifeMC::lives::%arg 1%}% &blives now."
  109. stop
Add Comment
Please, Sign In to add comment