Advertisement
IchinoseYuki

IY-Dice.sk v2.4

Feb 19th, 2020
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. #Written by IchinoseYuki (Discord:一ノ瀬雪#1027)
  2. #Request: IY-Core Ver:1.0 or later
  3. #Recommended: IY-Core Ver:1.2 or later
  4.  
  5. on script load:
  6. broadcast "&e&l&k|||&9&l[&b&lIchinoseYuki Skript - Dice&9&l]&e&l&k|||&r &7Ver.2.4"
  7.  
  8. command /dice [<string>] [<string>]:
  9. trigger:
  10. if arg-1 is not set:
  11. set {_error.1} to 1
  12. if arg-1 parsed as number is not more than 0:
  13. if arg-2 is not set:
  14. set {_error.2} to 1
  15. else:
  16. if arg-2 parsed as number is not more than 0:
  17. set {_error.2} to 2
  18. else:
  19. set {_error.2} to 3
  20. else if arg-2 is not set:
  21. set {_success.1} to true
  22. else if arg-2 is set:
  23. if arg-2 parsed as number is not more than 0:
  24. set {_error.2} to 4
  25. else if arg-2 parsed as number is 1:
  26. set {_success.1} to true
  27. else:
  28. set {_success.2} to true
  29. if {_success.1} is true:
  30. send "&aSuccess: &rThe dice roll is %random integer between 1 and arg-1 parsed as number%." if {IY::config::%uuid of player%::language} is "en"
  31. send "&a成功: &rサイコロの目は %random integer between 1 and arg-1 parsed as number% です。" if {IY::config::%uuid of player%::language} is "ja"
  32. if {_success.2} is true:
  33. loop arg-2 parsed as number time:
  34. add random integer between 1 and arg-1 parsed as number to {_dice::*}
  35. send "&aSuccess: &rThe dice rolls are %{_dice::*}%." if {IY::config::%uuid of player%::language} is "en"
  36. {IY::config::%uuid of player%::language} is "ja"
  37. set {_dice} to "%{_dice::*}%"
  38. replace all " and" with "," in {_dice}
  39. send "&a成功: &rサイコロの目は %{_dice}% です。"
  40. if {_error.1} is set:
  41. send "&4Error: &rSpecify argument for command." if {IY::config::%uuid of player%::language} is "en"
  42. send "&4失敗: &rコマンドの引数を指定してください。" if {IY::config::%uuid of player%::language} is "ja"
  43. if {_error.2} is set:
  44. send "&4Error: &rIncorrect argument for command." if {IY::config::%uuid of player%::language} is "en"
  45. send "&4失敗: &rコマンドの引数の指定が間違っています。" if {IY::config::%uuid of player%::language} is "ja"
  46. send "&0: &7/dice &c&n%arg-1%" if {_error.2} is 1
  47. send "&0: &7/dice &c&n%arg-1% %arg-2%" if {_error.2} is 2
  48. send "&0: &7/dice &c&n%arg-1%&7 %arg-2%" if {_error.2} is 3
  49. send "&0: &7/dice %arg-1% &c&n%arg-2%" if {_error.2} is 4
  50.  
  51. on tab complete:
  52. set {_args::*} to substring of event-string from 2 to length of event-string split at " "
  53. {_args::1} is "dice"
  54. if size of {_args::*} is 2:
  55. the first 1 characters of {_args::2} is not set
  56. add "&5<&eRoll&5>&r" to completions
  57. if size of {_args::*} is 3:
  58. the first 1 characters of {_args::3} is not set
  59. add "&5<&eAmount&5>&r" to completions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement