IchinoseYuki

IY-Sudo.sk v1.1

Nov 16th, 2019
102
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 - Sudo&9&l]&e&l&k|||&r &7Ver.1.1"
  6.  
  7. command /sudo [<string>]:
  8. trigger:
  9. if player doesn't have permission "skript.iy.sudo":
  10. sender is a player
  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. set {_AG} to arg
  15. set {_AG::*} to {_AG} split at " "
  16. set {_PL} to {_AG::1} parsed as player
  17. if {_AG::2} is not set:
  18. send "&4Error: &rSpecify argument for command." if {IY::config::%uuid of player%::language} is "en"
  19. send "&4失敗: &rコマンドの引数を指定してください。" if {IY::config::%uuid of player%::language} is "ja"
  20. stop
  21. set {_CM} to last length of arg - length of {_AG::1} + -1 characters of {_AG}
  22. if {_PL} is not set:
  23. send "&4Error: &r%{_AG::1}% is offline.%nl%&0: &7/sudo &c&n%{_AG::1}%&7 %{_CM}%" if {IY::config::%uuid of player%::language} is "en"
  24. send "&4失敗: &r%{_AG::1}%はオフラインです。%nl%&0: &7/sudo &c&n%{_AG::1}%&7 %{_CM}%" if {IY::config::%uuid of player%::language} is "ja"
  25. stop
  26. execute {_PL} command "/%{_CM}%"
  27. send "&aSuccess: &rHave %{_PL}% execute /%{_CM}%." if {IY::config::%uuid of player%::language} is "en"
  28. send "&a成功: &r%{_PL}%に/%{_CM}%を実行させました。" if {IY::config::%uuid of player%::language} is "ja"
  29.  
  30. on tab complete:
  31. set {_args::*} to substring of event-string from 2 to length of event-string split at " "
  32. {_args::1} is "sudo"
  33. if size of {_args::*} is 2:
  34. loop all players:
  35. loop-player is not player
  36. add "%loop-player%" to {_comp::*}
  37. loop {_comp::*}:
  38. set {_size} to length of {_args::2}
  39. if the first {_size} characters of {_args::2} is the first {_size} characters of loop-value:
  40. add loop-value to completions
  41. if completions is not set:
  42. add {_comp::*} to completions
RAW Paste Data