kicking is banning people

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Feb 10, 2021
18
0
1
22
  1. Script Version 2.5.3
  2. Script Author: bensku
  3. Minecraft Version: 1.16.4
  4. Full Code:
  5. Code:
    command /punish <player>:
        permission: perm3.punish
        trigger:
            set metadata tag "BanInvMeta01" of player to chest inventory with 1 row named "&8Punish"
            set slot 4 of metadata tag "BanInvMeta01" of player to arg 1's head named "%arg-1%" with lore "&c&lPick their punishment"
            open (metadata tag "BanInvMeta01" of player) to player
            set {argument.%player%} to arg 1
     
    on inventory click:
        event-inventory = (metadata tag "BanInvMeta01" of player):
            index of event-slot = 4:
                set metadata tag "BanInv2Meta01" of player to chest inventory with 3 row named "&8Pick the punishment"
                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."
                set slot 12 of metadata tag "BanInv2Meta01" of player to eye of ender named "&5&lMute" with lore "&7Will u &5&lmute &7this person."
                set slot 11 of metadata tag "BanInv2Meta01" of player to diamond boots named "&4&lKick" with lore "&7Will u &4&lkick &7this person."
                set slot 14 of metadata tag "BanInv2Meta01" of player to barrier named "&c&lBan" with lore "&7Will u &c&lban &7this person."
                set slot 15 of metadata tag "BanInv2Meta01" of player to eye of ender named "&b&lFreeze" with lore "&7Will u &b&lfreeze &7this person."
                send "&dPick who u wanna &c&lPunish!" to player
                open (metadata tag "BanInv2Meta01" of player) to player
    
    on inventory click:
        event-inventory = (metadata tag "BanInvMeta01" of player):
            cancel event
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 12:
                set {muted::%uuid of player%} to 1
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 11:
                kick {argument.%player%} due to "&c&lKicked &7by a staff member!"
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 11:
                ban {argument.%player%}
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 15:
                set {frozen::%uuid of player%} to 1
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            cancel event
    
    
    [*]
    
    [*]
    
    [*]
    
    [*][B]Errors on Reload:[/B]
    [*]
    
    [*]none but it bans people when i kick them
    [*]
    
    [*][B]Console Errors: (if applicable)[/B]
    [*]none
    [*]
    
    [*][B]Other Useful Info:[/B]
    [*]
    
    [*][B]Addons using (including versions):[/B]
    [*]erzats skquery skdragon tuske
    [*][B]Troubleshooting:[/B]
    [*]
    
    [*][B]Have you tried searching the docs? yes
    [*]Have you tried searching the [URL='https://forums.skunity.com/wiki/forums/']Forums[/URL]? yes
    [*]What other methods have you tried to fix it?[/B]
    [*]changing the code alot
    [/LIST]
 
Code:
on inventory click:
    event-inventory = (metadata tag "BanInv2Meta01" of player):
        index of event-slot = 11:
            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:
on inventory click:
    event-inventory = (metadata tag "BanInv2Meta01" of player):
        index of event-slot = 14:
            ban {argument.%player%}
 
Last edited:
Status
Not open for further replies.