akon1248

Untitled

Mar 15th, 2019
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. command /weapon <text> <text> <integer> <number> <number>:
  2. permission: weapon.admin
  3. permission message: &cYou do not have permission to use this command.
  4. usage: /weapon <武器名> <ポーションエフェクト> <ポーションレベル> <秒数> <確率>
  5. trigger:
  6. set {_potion} to arg-2 parsed as potioneffecttype
  7. if {_potion} is not set:
  8. send "&c無効なポーションエフェクト名です"
  9. else if arg-3 > 127:
  10. send "&cポーションレベルは0~127の整数を入力してください"
  11. else if arg-3 < 0:
  12. send "&cポーションレベルは0~127の整数を入力してください"
  13. else if arg-5 > 100:
  14. send "&c確率は0~100の数値を入力してください"
  15. else if arg-5 < 0:
  16. send "&c確率は0~100の数値を入力してください"
  17. else if player's tool is air:
  18. send "&cメインハンドにアイテムを持ってください"
  19. else:
  20. set name of player's tool to colored arg-1
  21. set {_lorelines} to size of lore of player's tool
  22. set {_lore} to "potion: %arg-2 in lower case% %arg-3% %arg-4% %arg-5%"
  23. set {_splits::*} to split {_lore} by ""
  24. set {_num} to size of {_splits::*}
  25. delete {_splits::%{_num}%}
  26. set {_lore} to "§%join {_splits::*} by ""§""%"
  27. set line {_lorelines}+1 of lore of player's tool to {_lore}
  28. send "&aポーション効果を付与しました"
  29.  
  30. on damage:
  31. attacker is a player
  32. set {_lore::*} to lore of attacker's tool
  33. loop {_lore::*}:
  34. first 16 characters of loop-value is "§p§o§t§i§o§n§:§ "
  35. set {_str} to loop-value
  36. replace "§" in {_str} with ""
  37. set {_splits::*} to split {_str} by " "
  38. delete {_splits::1}
  39. set {_potion} to {_splits::2} parsed as potioneffecttype
  40. set {_tier} to {_splits::3} parsed as integer
  41. set {_seconds} to "%{_splits::4}% seconds" parsed as timespan
  42. set {_chance} to {_splits::5} parsed as number
  43. chance of {_chance}%:
  44. apply {_potion} of tier {_tier} to attacker for {_seconds} and ambient true hide particle false
Advertisement
Add Comment
Please, Sign In to add comment