IchinoseYuki

IY-Gamemode+.sk v1.2

Dec 3rd, 2019
35
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Written by IchinoseYuki (Discord:一ノ瀬雪#1027)
  2. #Request: IY-Core Ver:1.0 or later
  3.  
  4. on script load:
  5. broadcast "&e&l&k|||&9&l[&b&lIchinoseYuki Skript - Gamemode+&9&l]&e&l&k|||&r &7Ver.1.2"
  6.  
  7. command /gamemode [<string>] [<string>]:
  8. aliases: /gm
  9. trigger:
  10. if player doesn't have permission "skript.iy.gamemode":
  11. sender is a player
  12. send "&4Error: &rYou don't have permission." if {IY::config::%uuid of player%::language} is "en"
  13. send "&4失敗: &rそのコマンドを使用する権限がありません。" if {IY::config::%uuid of player%::language} is "ja"
  14. stop
  15. if arg-1 is not set:
  16. send "&4Error: &rSpecify argument for command." if {IY::config::%uuid of player%::language} is "en"
  17. send "&4失敗: &rコマンドの引数を指定してください。" if {IY::config::%uuid of player%::language} is "ja"
  18. stop
  19. if arg-1 is not "0" or "s" or "survival" or "1" or "c" or "creative" or "2" or "a" or "adventure" or "3" or "sp" or "spectator":
  20. if arg-2 is not set:
  21. send "&4Error: &rIncorrect argument for command.%nl%&0: &7/gamemode &c&n%arg-1%" if {IY::config::%uuid of player%::language} is "en"
  22. send "&4失敗: &rコマンドの引数の指定が間違っています。%nl%&0: &7/gamemode &c&n%arg-1%" if {IY::config::%uuid of player%::language} is "ja"
  23. if arg-2 is set:
  24. if the first 2 characters of arg-2 is "@a" or "@p" or "@r" or "@e" or "@s":
  25. if the first 2 characters of arg-2 is "@e":
  26. send "&4Error: &rIncorrect argument for command.%nl%&0: &rOnly players may be affected by this command.%nl%&0: &7/gamemode &c&n%arg-1% %arg-2%" if {IY::config::%uuid of player%::language} is "en"
  27. send "&4失敗: &rコマンドの引数の指定が間違っています。%nl%&0: &rこのコマンドはプレイヤーに対してのみ有効です。%nl%&0: &7/gamemode &c&n%arg-1% %arg-2%" if {IY::config::%uuid of player%::language} is "ja"
  28. stop
  29. if the part of arg-2 between index 3 and index 3 is "[":
  30. set {_a2} to arg-2
  31. set {_op::*} to {_a2} split at "["
  32. send "&4Error: &rIncorrect argument for command.%nl%&0: &rThe selector option is not yet supported.%nl%&0: &7/gamemode &c&n%arg-1% &7%{_op::1}%&c&n[%{_op::2}%" if {IY::config::%uuid of player%::language} is "en"
  33. send "&4失敗: &rコマンドの引数の指定が間違っています。%nl%&0: &rセレクターオプションはまだサポートされていません。%nl%&0: &7/gamemode &c&n%arg-1% &7%{_op::1}%&c&n[%{_op::2}%" if {IY::config::%uuid of player%::language} is "ja"
  34. stop
  35. send "&4Error: &rIncorrect argument for command.%nl%&0: &7/gamemode &c&n%arg-1%&7 %arg-2%" if {IY::config::%uuid of player%::language} is "en"
  36. send "&4失敗: &rコマンドの引数の指定が間違っています。%nl%&0: &7/gamemode &c&n%arg-1%&7 %arg-2%" if {IY::config::%uuid of player%::language} is "ja"
  37. if the first 2 characters of arg-2 is not "@a" or "@p" or "@r" or "@e" or "@s":
  38. if arg-2 parsed as offline player is online:
  39. send "&4Error: &rIncorrect argument for command.%nl%&0: &7/gamemode &c&n%arg-1%&7 %arg-2%" if {IY::config::%uuid of player%::language} is "en"
  40. send "&4失敗: &rコマンドの引数の指定が間違っています。%nl%&0: &7/gamemode &c&n%arg-1%&7 %arg-2%" if {IY::config::%uuid of player%::language} is "ja"
  41. else:
  42. send "&4Error: &rIncorrect argument for command.%nl%&0: &r%arg-2% is offline.%nl%&0: &7/gamemode &c&n%arg-1% %arg-2%" if {IY::config::%uuid of player%::language} is "en"
  43. send "&4失敗: &rコマンドの引数の指定が間違っています。%nl%&0: &r%arg-2%はオフラインです。%nl%&0: &7/gamemode &c&n%arg-1% %arg-2%" if {IY::config::%uuid of player%::language} is "ja"
  44. stop
  45. if arg-2 is set:
  46. if arg-1 is "0" or "0" or "s" or "survival":
  47. set {_gm} to survival
  48. if arg-1 is "1" or "1" or "c" or "creative":
  49. set {_gm} to creative
  50. if arg-1 is "2" or "2" or "a" or "adventure":
  51. set {_gm} to adventure
  52. if arg-1 is "3" or "3" or "sp" or "spectator":
  53. set {_gm} to spectator
  54. loop all players:
  55. add loop-player to {_p::*}
  56. if the first 2 characters of arg-2 is "@a" or "@p" or "@r" or "@e" or "@s":
  57. if the first 2 characters of arg-2 is "@e":
  58. send "&4Error: &rOnly players may be affected by this command.%nl%&0: &7/gamemode %arg-1% &c&n%arg-2%" if {IY::config::%uuid of player%::language} is "en"
  59. send "&4失敗: &rこのコマンドはプレイヤーに対してのみ有効です。%nl%&0: &7/gamemode %arg-1% &c&n%arg-2%" if {IY::config::%uuid of player%::language} is "ja"
  60. stop
  61. if the part of arg-2 between index 3 and index 3 is "[":
  62. set {_a2} to arg-2
  63. set {_op::*} to {_a2} split at "["
  64. send "&4Error: &rThe selector option is not yet supported.%nl%&0: &7/gamemode %arg-1% %{_op::1}%&c&n[%{_op::2}%" if {IY::config::%uuid of player%::language} is "en"
  65. send "&4失敗: &rセレクターオプションはまだサポートされていません。%nl%&0: &7/gamemode %arg-1% %{_op::1}%&c&n[%{_op::2}%" if {IY::config::%uuid of player%::language} is "ja"
  66. stop
  67. if the first 2 characters of arg-2 is "@a":
  68. set gamemode of {_p::*} to {_gm}
  69. send "&aSuccess: &rChanged all players' game mode to %{_gm}%." if {IY::config::%uuid of player%::language} is "en"
  70. send "&a成功: &rすべてのプレイヤーのゲームモードを%{_gm}%に変更しました。" if {IY::config::%uuid of player%::language} is "ja"
  71. if the first 2 characters of arg-2 is "@p" or "@s":
  72. set gamemode of player to {_gm}
  73. send "&aSuccess: &rChanged your game mode to %{_gm}%." if {IY::config::%uuid of player%::language} is "en"
  74. send "&a成功: &rあなたのゲームモードを%{_gm}%に変更しました。" if {IY::config::%uuid of player%::language} is "ja"
  75. if the first 2 characters of arg-2 is "@r":
  76. set {_p} to random element out of {_p::*}
  77. set gamemode of {_p} to {_gm}
  78. send "&aSuccess: &rChanged %{_p}%'s game mode to %{_gm}%." if {IY::config::%uuid of player%::language} is "en"
  79. send "&a成功: &r%{_p}%のプレイヤーのゲームモードを%{_gm}%に変更しました。" if {IY::config::%uuid of player%::language} is "ja"
  80. if the first 2 characters of arg-2 is not "@a" or "@p" or "@r" or "@e" or "@s":
  81. if arg-2 parsed as offline player is online:
  82. set gamemode of arg-2 parsed as player to {_gm}
  83. send "&aSuccess: &rChanged %arg-2%'s game mode to %{_gm}%." if {IY::config::%uuid of player%::language} is "en"
  84. send "&a成功: &r%arg-2%のゲームモードを%{_gm}%に変更しました。" if {IY::config::%uuid of player%::language} is "ja"
  85. stop
  86. send "&4Error: &r%arg-2% is offline.%nl%&0: &7/gamemode %arg-1% &c&n%arg-2%" if {IY::config::%uuid of player%::language} is "en"
  87. send "&4失敗: &r%arg-2%はオフラインです。%nl%&0: &7/gamemode %arg-1% &c&n%arg-2%" if {IY::config::%uuid of player%::language} is "ja"
  88. stop
  89. if arg-2 is not set:
  90. if arg-1 is "0" or "0" or "s" or "survival":
  91. set {_gm} to survival
  92. if arg-1 is "1" or "1" or "c" or "creative":
  93. set {_gm} to creative
  94. if arg-1 is "2" or "2" or "a" or "adventure":
  95. set {_gm} to adventure
  96. if arg-1 is "3" or "3" or "sp" or "spectator":
  97. set {_gm} to spectator
  98. set gamemode of player to {_gm}
  99. send "&aSuccess: &rChanged your game mode to %{_gm}%." if {IY::config::%uuid of player%::language} is "en"
  100. send "&a成功: &rゲームモードを%{_gm}%に変更しました。" if {IY::config::%uuid of player%::language} is "ja"
  101. stop
  102.  
  103. on tab complete:
  104. set {_args::*} to substring of event-string from 2 to length of event-string split at " "
  105. {_args::1} is "gamemode" #label
  106. if size of {_args::*} is 2: #arg-1
  107. set {_comp::*} to "adventure", "creative", "spectator" and "survival"
  108. loop {_comp::*}:
  109. set {_size} to length of {_args::2}
  110. if the first {_size} characters of {_args::2} is the first {_size} characters of loop-value:
  111. add loop-value to completions
  112. if the first 1 characters of {_args::2} is not set:
  113. add "adventure", "creative", "spectator" and "survival" to completions
  114. if size of {_args::*} is 3: #arg-2
  115. loop all players:
  116. add "%loop-player%" to {_comp::*}
  117. loop {_comp::*}:
  118. set {_size} to length of {_args::3}
  119. if the first {_size} characters of {_args::3} is the first {_size} characters of loop-value:
  120. add loop-value to completions
  121. if the first 1 characters of {_args::3} is not set:
  122. loop all players:
  123. add "%loop-player%" to completions
RAW Paste Data