kjfalkeiae

Untitled

Nov 12th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.26 KB | None | 0 0
  1. variables:
  2. {exp.%player%} = 0
  3. {level.%player%} = 1
  4. {needexp.%player%} = 1000
  5. {rgn.%player%} = 1
  6. {spd.%player%} = 1
  7. {stamina.%player%} = 14
  8. {exhaustion.%player%} = 0
  9. on load:
  10. execute console command "/gamerule naturalRegeneration false"
  11. every tick:
  12. loop all players:
  13. set {_stamina} to {stamina.%loop-player%}+6
  14. set loop-player's food to {_stamina}/2
  15. set level of loop-player to {level.%loop-player%}
  16. set level progress of loop-player to {exp.%loop-player%}/{needexp.%loop-player%}
  17. if {level.%loop-player%} is smaller than or equal to 90:
  18. set {def.%loop-player%} to {level.%loop-player%}-1
  19. if {level.%loop-player%} is greater than or equal to 91:
  20. set {def.%loop-player%} to 90
  21. if {exp.%loop-player%} is greater than or equal to {needexp.%loop-player%}:
  22. set {exp.%loop-player%} to {exp.%loop-player%}-{needexp.%loop-player%}
  23. set {needexp.%loop-player%} to {needexp.%loop-player%}*1.05
  24. set {needexp.%loop-player%} to round({needexp.%loop-player%})/100
  25. set {needexp.%loop-player%} to round({needexp.%loop-player%})
  26. set {needexp.%loop-player%} to {needexp.%loop-player%}*100
  27. add 1 to {level.%loop-player%}
  28. send loop-player title "&a&lLEVEL UP" with subtitle "&aYour are now LEVEL %{level.%loop-player%}%!" for 1 seconds with 0 seconds fade in and 0.5 seconds fade out
  29. play sound "entity_player_levelup" to loop-player with volume 1 and pitch 5
  30. set {_healthraito} to loop-player's health/max health of loop-player
  31. add 0.5 to max health of loop-player
  32. set loop-player's health to max health of loop-player*{_healthraito}
  33. if {level.%loop-player%} is 10:
  34. set {rgn.%loop-player%} to 2
  35. if {level.%loop-player%} is 20:
  36. set {rgn.%loop-player%} to 3
  37. if {level.%loop-player%} is 30:
  38. set {rgn.%loop-player%} to 4
  39. set {spd.%loop-player%} to 2
  40. set loop-player's walk speed to 0.3
  41. if {level.%loop-player%} is 40:
  42. set {rgn.%loop-player%} to 5
  43. if {level.%loop-player%} is 50:
  44. set {rgn.%loop-player%} to 6
  45. if {level.%loop-player%} is 60:
  46. set {rgn.%loop-player%} to 7
  47. set {spd.%loop-player%} to 3
  48. set loop-player's walk speed to 0.4
  49. if {level.%loop-player%} is 70:
  50. set {rgn.%loop-player%} to 8
  51. if {level.%loop-player%} is 80:
  52. set {rgn.%loop-player%} to 9
  53. if {level.%loop-player%} is 90:
  54. set {rgn.%loop-player%} to 10
  55. wipe loop-player sidebar
  56. set name of sidebar of loop-player to "&6&lYour Status"
  57. set score "&aLEVEL: %{level.%loop-player%}%" in sidebar of loop-player to 0
  58. set score "&eEXP: %{exp.%loop-player%}%/%{needexp.%loop-player%}%" in sidebar of loop-player to -1
  59. set score "&4ATK: %{level.%loop-player%}%" in sidebar of loop-player to -2
  60. set score "&9DEF: %{def.%loop-player%}%" in sidebar of loop-player to -3
  61. set score "&dRGN: %{rgn.%loop-player%}%" in sidebar of loop-player to -4
  62. set score "&bSPD: %{spd.%loop-player%}%" in sidebar of loop-player to -5
  63. set score "&cHP: %round(loop-player's health*2)%/%max health of loop-player*2%" in sidebar of loop-player to -6
  64. set {_targetentity} to target of loop-player
  65. {_targetentity} is not armor stand
  66. if health of target of loop-player is greater than or equal to 1:
  67. if {_targetentity} is set:
  68. set {_targetentityname} to name of {_targetentity}
  69. if {_targetentityname} is set:
  70. send action bar from "%name of target of loop-player% &c%round(health of target of loop-player*2)%&7/&a%max health of target of loop-player*2%" to loop-player
  71. if {_targetentityname} is not set:
  72. send action bar from "%target of loop-player% &c%round(health of target of loop-player*2)%&7/&a%max health of target of loop-player*2%" to loop-player
  73. on death:
  74. wait 1 tick
  75. force victim to respawn
  76. wait 2 tick
  77. send player title "&c&lGAME OVER" with subtitle "&cYOU DIED" for 3 seconds with 0 seconds fade in and 1 seconds fade out
  78. execute console command "/effect %player% 15 3 0 true"
  79. on xp spawn:
  80. cancel event
  81. on death:
  82. attacker is a player
  83. victim is not player
  84. victim is not armor stand
  85. set {_exp} to max health of victim*4
  86. add {_exp} to {exp.%attacker%}
  87. send "&a+%{_exp}%EXP" to attacker
  88. command /resetstatus [<offline player>]:
  89. permission: skript.admin
  90. usage: /resetstatus <player>
  91. trigger:
  92. set {level.%arg-1%} to 1
  93. set {exp.%arg-1%} to 0
  94. set {needexp.%arg-1%} to 1000
  95. set max health of arg-1 to 10
  96. set arg-1's health to 10
  97. set {rgn.%arg-1%} to 1
  98. set {spd.%arg-1%} to 1
  99. set arg-1's walk speed to 0.2
  100. set {stamina.%arg-1%} to 14
  101. on damage:
  102. attacker is a player
  103. if damage was caused by entity explosion:
  104. stop
  105. if damage was caused by projectile:
  106. stop
  107. if damage was caused by potion:
  108. stop
  109. else:
  110. set {_adddamage} to {level.%attacker%}-1
  111. set {_adddamage} to {_adddamage}/2
  112. add {_adddamage} to damage
  113. on damage:
  114. victim is a player
  115. set {_reduction} to 100-{def.%victim%}
  116. set {_reduction} to {_reduction}/100
  117. set damage to damage*{_reduction}
  118. every 80 tick:
  119. loop all players:
  120. if loop-player's health is greater than 0:
  121. if {rgn.%loop-player%} is 1:
  122. if loop-player's health is smaller than or equal to max health of loop-player:
  123. add 0.5 to loop-player's health
  124. every 72 tick:
  125. loop all players:
  126. if loop-player's health is greater than 0:
  127. if {rgn.%loop-player%} is 2:
  128. if loop-player's health is smaller than or equal to max health of loop-player:
  129. add 0.5 to loop-player's health
  130. every 64 tick:
  131. loop all players:
  132. if loop-player's health is greater than 0:
  133. if {rgn.%loop-player%} is 3:
  134. if loop-player's health is smaller than or equal to max health of loop-player:
  135. add 0.5 to loop-player's health
  136. every 57 tick:
  137. loop all players:
  138. if loop-player's health is greater than 0:
  139. if {rgn.%loop-player%} is 4:
  140. if loop-player's health is smaller than or equal to max health of loop-player:
  141. add 0.5 to loop-player's health
  142. every 49 tick:
  143. loop all players:
  144. if loop-player's health is greater than 0:
  145. if {rgn.%loop-player%} is 5:
  146. if loop-player's health is smaller than or equal to max health of loop-player:
  147. add 0.5 to loop-player's health
  148. every 41 tick:
  149. loop all players:
  150. if loop-player's health is greater than 0:
  151. if {rgn.%loop-player%} is 6:
  152. if loop-player's health is smaller than or equal to max health of loop-player:
  153. add 0.5 to loop-player's health
  154. every 33 tick:
  155. loop all players:
  156. if loop-player's health is greater than 0:
  157. if {rgn.%loop-player%} is 7:
  158. if loop-player's health is smaller than or equal to max health of loop-player:
  159. add 0.5 to loop-player's health
  160. every 24 tick:
  161. loop all players:
  162. if loop-player's health is greater than 0:
  163. if {rgn.%loop-player%} is 8:
  164. if loop-player's health is smaller than or equal to max health of loop-player:
  165. add 0.5 to loop-player's health
  166. every 15 tick:
  167. loop all players:
  168. if loop-player's health is greater than 0:
  169. if {rgn.%loop-player%} is 9:
  170. if loop-player's health is smaller than or equal to max health of loop-player:
  171. add 0.5 to loop-player's health
  172. every 3 tick:
  173. loop all players:
  174. if loop-player's health is greater than 0:
  175. if {rgn.%loop-player%} is 10:
  176. if loop-player's health is smaller than or equal to max health of loop-player:
  177. add 0.5 to loop-player's health
  178. command /exp [<player>] [<number>]:
  179. permission: skript.admin
  180. usage: /exp <player> <velue>
  181. trigger:
  182. if arg-2 is greater than or equal to 1:
  183. add arg-2 to {exp.%arg-1%}
  184. on damage:
  185. victim is a player
  186. if damage was caused by starvation:
  187. cancel event
  188. every 8 tick:
  189. loop all players:
  190. loop-player's gamemode is adventure or survival
  191. if loop-player is sprinting:
  192. if {stamina.%loop-player%} is greater than or equal to 1:
  193. remove 1 from {stamina.%loop-player%}
  194. if {stamina.%loop-player%} is 0:
  195. set loop-player's walk speed to loop-player's walk speed/2
  196. set {exhaustion.%loop-player%} to 1
  197. wait 84 tick
  198. set {exhaustion.%loop-player%} to 0
  199. set loop-player's walk speed to loop-player's walk speed*2
  200. every 6 tick:
  201. loop all players:
  202. if loop-player is not sprinting:
  203. if {stamina.%loop-player%} is smaller than or equal to 13:
  204. add 1 to {stamina.%loop-player%}
  205. on player sprint toggle:
  206. player's gamemode is adventure or survival
  207. if {exhaustion.%player%} is 1:
  208. if player is not sprinting:
  209. cancel event
Add Comment
Please, Sign In to add comment