IchinoseYuki

IY-Gamemode+.sk v1.0

Oct 27th, 2019
23
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.0"
  6.  
  7. command /gamemode [<string>] [<string>]:
  8. aliases: /gm
  9. trigger:
  10. if player doesn't have permission "skript.iy.gamemode":
  11. send "&4Error: &rYou don't have permission." if {IY::config::%uuid of player%::language} is "en"
  12. send "&4失敗: &rそのコマンドを使用する権限がありません。" if {IY::config::%uuid of player%::language} is "ja"
  13. stop
  14. if arg-1 is not set:
  15. send "&4Error: &rSpecify argument for command." if {IY::config::%uuid of player%::language} is "en"
  16. send "&4失敗: &rコマンドの引数を指定してください。" if {IY::config::%uuid of player%::language} is "ja"
  17. stop
  18. 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":
  19. if arg-2 is not set:
  20. send "&4Error: &rIncorrect argument for command.%nl%&0: &7/gamemode &c&n%arg-1%" if {IY::config::%uuid of player%::language} is "en"
  21. send "&4失敗: &rコマンドの引数の指定が間違っています。%nl%&0: &7/gamemode &c&n%arg-1%" if {IY::config::%uuid of player%::language} is "ja"
  22. if arg-2 is set:
  23. loop all players:
  24. add loop-player to {_p::*}
  25. if {_p::*} contains arg-2:
  26. 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"
  27. send "&4失敗: &rコマンドの引数の指定が間違っています。%nl%&0: &7/gamemode &c&n%arg-1%&7 %arg-2%" if {IY::config::%uuid of player%::language} is "ja"
  28. if {_p::*} doesn't contain arg-2:
  29. 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"
  30. 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"
  31. stop
  32. if arg-2 is set:
  33. loop all players:
  34. add loop-player to {_p::*}
  35. if {_p::*} doesn't contain arg-2:
  36. 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"
  37. send "&4失敗: &r%arg-2%はオフラインです。%nl%&0: &7/gamemode %arg-1% &c&n%arg-2%" if {IY::config::%uuid of player%::language} is "ja"
  38. stop
  39. if arg-1 is "0" or "0" or "s" or "survival":
  40. set {_gm} to survival
  41. if arg-1 is "1" or "1" or "c" or "creative":
  42. set {_gm} to creative
  43. if arg-1 is "2" or "2" or "a" or "adventure":
  44. set {_gm} to adventure
  45. if arg-1 is "3" or "3" or "sp" or "spectator":
  46. set {_gm} to spectator
  47. set gamemode of arg-2 parsed as player to {_gm}
  48. send "&aSuccess: &rChanged %arg-2%'s game mode to %{_gm}%." if {IY::config::%uuid of player%::language} is "en"
  49. send "&a成功: &r%arg-2%のゲームモードを%{_gm}%に変更しました。" if {IY::config::%uuid of player%::language} is "ja"
  50. stop
  51. if arg-2 is not set:
  52. if arg-1 is "0" or "0" or "s" or "survival":
  53. set {_gm} to survival
  54. if arg-1 is "1" or "1" or "c" or "creative":
  55. set {_gm} to creative
  56. if arg-1 is "2" or "2" or "a" or "adventure":
  57. set {_gm} to adventure
  58. if arg-1 is "3" or "3" or "sp" or "spectator":
  59. set {_gm} to spectator
  60. set gamemode of player to {_gm}
  61. send "&aSuccess: &rChanged your game mode to %{_gm}%." if {IY::config::%uuid of player%::language} is "en"
  62. send "&a成功: &rゲームモードを%{_gm}%に変更しました。" if {IY::config::%uuid of player%::language} is "ja"
  63. stop
  64.  
  65. on tab complete:
  66. set {_args::*} to substring of event-string from 2 to length of event-string split at " "
  67. {_args::1} is "gamemode" #label
  68. if size of {_args::*} is 2: #arg-1
  69. set {_comp::*} to "adventure", "creative", "spectator" and "survival"
  70. loop {_comp::*}:
  71. set {_size} to length of {_args::2}
  72. if the first {_size} characters of {_args::2} is the first {_size} characters of loop-value:
  73. add loop-value to completions
  74. if the first 1 characters of {_args::2} is not set:
  75. add "adventure", "creative", "spectator" and "survival" to completions
  76. if size of {_args::*} is 3: #arg-2
  77. loop all players:
  78. add "%loop-player%" to {_comp::*}
  79. loop {_comp::*}:
  80. set {_size} to length of {_args::3}
  81. if the first {_size} characters of {_args::3} is the first {_size} characters of loop-value:
  82. add loop-value to completions
  83. if the first 1 characters of {_args::3} is not set:
  84. loop all players:
  85. add "%loop-player%" to completions
RAW Paste Data