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.

help with ban

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

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

    Joined:
    Feb 10, 2021
    Messages:
    18
    Likes Received:
    0
    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 (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 true
      29.             wait 10 ticks
      30.             set {unmuted::%uuid of player%} to true
      31.             play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
      32.  
      33. on inventory click:
      34.     event-inventory = (metadata tag "BanInv2Meta01" of player):
      35.         index of event-slot = 12:
      36.             {unmuted::%uuid of player%} is true
      37.             set {muted::%uuid of player%} to false
      38.             wait 10 ticks
      39.             set {unmuted::%uuid of player%} to false
      40.             play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
      41.  
      42. on inventory click:
      43.     event-inventory = (metadata tag "BanInv2Meta01" of player):
      44.         index of event-slot = 11:
      45.             kick {argument.%player%} due to "&c&lKicked &7by a staff member!"
      46.             play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
      47.  
      48. on inventory click:
      49.     event-inventory = (metadata tag "BanInv2Meta01" of player):
      50.         index of event-slot = 14:
      51.             ban {argument.%player%} due to "&c&lBanned &7by a staff member!"
      52.             play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
      53.  
      54. on inventory click:
      55.     event-inventory = (metadata tag "BanInv2Meta01" of player):
      56.         index of event-slot = 15:
      57.             set {frozen::%uuid of player%} to true
      58.             wait 10 ticks
      59.             set {unfrozen::%uuid of player%} to true
      60.             play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
      61.  
      62. on inventory click:
      63.     event-inventory = (metadata tag "BanInv2Meta01" of player):
      64.         index of event-slot = 15:
      65.             {unfrozen::%uuid of player%} is true
      66.             set {frozen::%uuid of player%} to false
      67.             wait 10 ticks
      68.             set {unfrozen::%uuid of player%} to false
      69.             play sound "entity.experience_orb.pickup" with volume 1 and pitch 1 at all players for all players
      70.  
      71. on inventory click:
      72.     event-inventory = (metadata tag "BanInv2Meta01" of player):
      73.         cancel event
      74.  
      75. on any movement:
      76.     {frozen::%uuid of player%} is true
      77.     cancel event
      78.  
      79. on chat:
      80.     {muted::%uuid of player%} is true
      81.     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?
     
  2. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    Vanilla inventories are not done that way. First of all, take a look at the tutorial on create a vanilla GUI.
     
  3. VoidOfCatastrophe

    Joined:
    Feb 10, 2021
    Messages:
    18
    Likes Received:
    0
    Could u tell me what i did wrong? And i just wanna know how to make it mute or freeze the other person.
    --- Double Post Merged, Mar 25, 2021, Original Post Date: Mar 25, 2021 ---
    Il fix up my script with else if and stuff but i still need help with how to mute or freeze the other person
     
  4. PatoFrango

    PatoFrango Active Member

    Joined:
    Jul 12, 2017
    Messages:
    240
    Likes Received:
    14
    The part of your script that mutes and freezes a player seems correct, try debugging it to see if those variables are set
     
Thread Status:
Not open for further replies.

Share This Page

Loading...