help with ban

  • 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 (do not put latest): 2.5.3
  2. Script Author: bensku
  3. Minecraft Version: 1.16.4
  4. Full Code:
  5. Note: If the code is too large, feel free to use a pasting website (Pastebin or Pastebin)
    [*]Note: If a variable is being set in another script, but not shown, please explain how they are being set
  6. 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 true
                wait 10 ticks
                set {unmuted::%uuid of player%} to true
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 12:
                {unmuted::%uuid of player%} is true
                set {muted::%uuid of player%} to false
                wait 10 ticks
                set {unmuted::%uuid of player%} to false
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    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!"
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 14:
                ban {argument.%player%} due to "&c&lBanned &7by a staff member!"
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 15:
                set {frozen::%uuid of player%} to true
                wait 10 ticks
                set {unfrozen::%uuid of player%} to true
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 15:
                {unfrozen::%uuid of player%} is true
                set {frozen::%uuid of player%} to false
                wait 10 ticks
                set {unfrozen::%uuid of player%} to false
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            cancel event
    
    on any movement:
        {frozen::%uuid of player%} is true
        cancel event
    
    on chat:
        {muted::%uuid of player%} is true
        cancel event


  7. Errors on Reload:
  8. none


  9. Console Errors: (if applicable)
  10. none

  11. Other Useful Info:

  12. Addons using (including versions):

  13. Troubleshooting:

  14. Have you tried searching the docs? yes
    [*]Have you tried searching the Forums? yes
    [*]What other methods have you tried to fix it?
 
  1. Script Version (do not put latest): 2.5.3
  2. Script Author: bensku
  3. Minecraft Version: 1.16.4
  4. Full Code:
  5. Note: If the code is too large, feel free to use a pasting website (Pastebin or Pastebin)
    [*]Note: If a variable is being set in another script, but not shown, please explain how they are being set
  6. 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 true
                wait 10 ticks
                set {unmuted::%uuid of player%} to true
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 12:
                {unmuted::%uuid of player%} is true
                set {muted::%uuid of player%} to false
                wait 10 ticks
                set {unmuted::%uuid of player%} to false
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    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!"
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 14:
                ban {argument.%player%} due to "&c&lBanned &7by a staff member!"
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 15:
                set {frozen::%uuid of player%} to true
                wait 10 ticks
                set {unfrozen::%uuid of player%} to true
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            index of event-slot = 15:
                {unfrozen::%uuid of player%} is true
                set {frozen::%uuid of player%} to false
                wait 10 ticks
                set {unfrozen::%uuid of player%} to false
                play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
    
    on inventory click:
        event-inventory = (metadata tag "BanInv2Meta01" of player):
            cancel event
    
    on any movement:
        {frozen::%uuid of player%} is true
        cancel event
    
    on chat:
        {muted::%uuid of player%} is true
        cancel event


  7. Errors on Reload:
  8. none


  9. Console Errors: (if applicable)
  10. none

  11. Other Useful Info:

  12. Addons using (including versions):

  13. Troubleshooting:

  14. Have you tried searching the docs? yes
    [*]Have you tried searching the Forums? yes
    [*]What other methods have you tried to fix it?

Vanilla inventories are not done that way. First of all, take a look at the tutorial on create a vanilla GUI.
 
Could u tell me what i did wrong? And i just wanna know how to make it mute or freeze the other person.
[doublepost=1616635048,1616634811][/doublepost]Il fix up my script with else if and stuff but i still need help with how to mute or freeze the other person
 
The part of your script that mutes and freezes a player seems correct, try debugging it to see if those variables are set
 
Status
Not open for further replies.