1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

kicking is banning people

Discussion in 'Skript' started by VoidOfCatastrophe, Mar 7, 2021.

Thread Status:
Not open for further replies.
  1. VoidOfCatastrophe

    Joined:
    Feb 10, 2021
    Messages:
    18
    Likes Received:
    0
    1. Script Version 2.5.3
    2. Script Author: bensku
    3. Minecraft Version: 1.16.4
    4. Full Code:
    5. Code (Text):
      1. command /punish <player>:
      2.     permission: perm3.punish
      3.     trigger:
      4.         set metadata tag "BanInvMeta01" of player to chest inventory with 1 row named "&8Punish"
      5.         set slot 4 of metadata tag "BanInvMeta01" of player to arg 1's head named "%arg-1%" with lore "&c&lPick their punishment"
      6.         open (metadata tag "BanInvMeta01" of player) to player
      7.         set {argument.%player%} to arg 1
      8.  
      9. on inventory click:
      10.     event-inventory = (metadata tag "BanInvMeta01" of player):
      11.         index of event-slot = 4:
      12.             set metadata tag "BanInv2Meta01" of player to chest inventory with 3 row named "&8Pick the punishment"
      13.             set slot 13 of metadata tag "BanInv2Meta01" of player to {argument.%player%}'s head named "&7&l&n%{argument.%player%}%" with lore "&d&lPick who u wanna punish."
      14.             set slot 12 of metadata tag "BanInv2Meta01" of player to eye of ender named "&5&lMute" with lore "&7Will u &5&lmute &7this person."
      15.             set slot 11 of metadata tag "BanInv2Meta01" of player to diamond boots named "&4&lKick" with lore "&7Will u &4&lkick &7this person."
      16.             set slot 14 of metadata tag "BanInv2Meta01" of player to barrier named "&c&lBan" with lore "&7Will u &c&lban &7this person."
      17.             set slot 15 of metadata tag "BanInv2Meta01" of player to eye of ender named "&b&lFreeze" with lore "&7Will u &b&lfreeze &7this person."
      18.             send "&dPick who u wanna &c&lPunish!" to player
      19.             open (metadata tag "BanInv2Meta01" of player) to player
      20.  
      21. on inventory click:
      22.     event-inventory = (metadata tag "BanInvMeta01" of player):
      23.         cancel event
      24.  
      25. on inventory click:
      26.     event-inventory = (metadata tag "BanInv2Meta01" of player):
      27.         index of event-slot = 12:
      28.             set {muted::%uuid of player%} to 1
      29.  
      30. on inventory click:
      31.     event-inventory = (metadata tag "BanInv2Meta01" of player):
      32.         index of event-slot = 11:
      33.             kick {argument.%player%} due to "&c&lKicked &7by a staff member!"
      34.  
      35. on inventory click:
      36.     event-inventory = (metadata tag "BanInv2Meta01" of player):
      37.         index of event-slot = 11:
      38.             ban {argument.%player%}
      39.  
      40. on inventory click:
      41.     event-inventory = (metadata tag "BanInv2Meta01" of player):
      42.         index of event-slot = 15:
      43.             set {frozen::%uuid of player%} to 1
      44.  
      45. on inventory click:
      46.     event-inventory = (metadata tag "BanInv2Meta01" of player):
      47.         cancel event
      48.  
      49.  
      50. [*]
      51.  
      52. [*]
      53.  
      54. [*]
      55.  
      56. [*][B]Errors on Reload:[/B]
      57. [*]
      58.  
      59. [*]none but it bans people when i kick them
      60. [*]
      61.  
      62. [*][B]Console Errors: (if applicable)[/B]
      63. [*]none
      64. [*]
      65.  
      66. [*][B]Other Useful Info:[/B]
      67. [*]
      68.  
      69. [*][B]Addons using (including versions):[/B]
      70. [*]erzats skquery skdragon tuske
      71. [*][B]Troubleshooting:[/B]
      72. [*]
      73.  
      74. [*][B]Have you tried searching the docs? yes
      75. [*]Have you tried searching the [URL='https://forums.skunity.com/wiki/forums/']Forums[/URL]? yes
      76. [*]What other methods have you tried to fix it?[/B]
      77. [*]changing the code alot
      78. [/LIST]
     
  2. Goose

    Supporter

    Joined:
    Nov 23, 2019
    Messages:
    422
    Likes Received:
    30
    Code (Text):
    1. on inventory click:
    2.     event-inventory = (metadata tag "BanInv2Meta01" of player):
    3.         index of event-slot = 11:
    4.             ban {argument.%player%}
    In this event, you're checking if the slot's index is 11 instead of 14, so it both kicks and bans them. You'll need to change it accordingly:
    Code (Text):
    1. on inventory click:
    2.     event-inventory = (metadata tag "BanInv2Meta01" of player):
    3.         index of event-slot = 14:
    4.             ban {argument.%player%}
     
    #2 Goose, Mar 7, 2021
    Last edited: Mar 7, 2021
  3. VoidOfCatastrophe

    Joined:
    Feb 10, 2021
    Messages:
    18
    Likes Received:
    0
    soz i needa stop making dumb mistakes
     
  4. Goose

    Supporter

    Joined:
    Nov 23, 2019
    Messages:
    422
    Likes Received:
    30
    No worries.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...