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.

Solved Staff Menu

Discussion in 'Skript' started by Cold, May 17, 2022.

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

    Cold Member

    Joined:
    May 1, 2022
    Messages:
    27
    Likes Received:
    0
    Hello I need help with creating a staff menu.

    code:
    Code (Text):
    1. command /kontrol [<offline player>]:
    2.     aliases: k, kon, styr, staff
    3.     permission: staff
    4.     permission message: &8&l[ &c&lSTAFF &8&l] &cDette kan du ikke!"
    5.     trigger:
    6.         if arg-1 is set:
    7.             set metadata tag "StaffGUI" of player to chest inventory with 5 rows named "&c&lKontroler"
    8.             set slot 0,1,2,3,4,5,6,7,8,36,37,38,39,41,42,43 and 44 of metadata tag "StaffGUI" of player to white stained glass pane named "&5&l"
    9.             set slot 20 of metadata tag "StaffGUI" of player to string named "" with lore ""
    10.             set slot 22 of metadata tag "StaffGUI" of player to stick named "" with lore ""
    11.             set slot 24 of metadata tag "StaffGUI" of player to shiny tnt named "&4&lSTRAF &6%arg-1%" with lore "&7Klik for at straffe &6%arg-1%!"
    12.             set slot 40 of metadata tag "StaffGUI" of player to redstone torch named "&c&lINDSTILLINGER" with lore "&f"
    13.             open (metadata tag "StaffGUI" of player) to player
    14.         else:
    15.             send "&8&l[ &c&lSTAFF &8&l] &7Du skal skrive en person!" to player
    16.  
    17. on inventory click:
    18.     name of player's current inventory = "&c&lKontroler":
    19.         cancel event
    20.         clicked slot = 24:
    21.             execute player command "/straf %arg-1%
    22.  
    23. command /straf [<offline player>]:
    24.     permission: staff
    25.     permission message: &8&l[ &c&lSTAFF &8&l] &cDette kan du ikke!"
    26.     trigger:
    27.         if arg-1 is set:
    28.             set metadata tag "StrafGUI" of player to chest inventory with 5 rows named "&c&lKontroler &6%arg-1%"
    29.             set slot 0,1,2,3,4,5,6,7,8,36,37,38,39,41,42,43 and 44 of metadata tag "StrafGUI" of player to white stained glass pane named "&5&l"
    30.             set slot 20 of metadata tag "StrafGUI" of player to string named "&c&lKICK" with lore "&7Klik for at straffe &6%arg-1%!"
    31.             set slot 22 of metadata tag "StrafGUI" of player to stick named "&3&lMUTE" with lore "&7Klik for at straffe &6%arg-1%!"
    32.             set slot 24 of metadata tag "StrafGUI" of player to shiny tnt named "&4&lBAN &6%arg-1%" with lore "&7Klik for at straffe &6%arg-1%!"
    33.             set slot 40 of metadata tag "StrafGUI" of player to redstone torch named "&c&lINDSTILLINGER" with lore "&f"
    34.             open (metadata tag "StrafGUI" of player) to player
    35.         else:
    36.             send "&8&l[ &c&lSTAFF &8&l] &7Du skal skrive en person!" to player


     
  2. Best Answer:
    Post #6 by BanditEagle, May 18, 2022
  3. Practice

    Practice Member

    Joined:
    Apr 23, 2022
    Messages:
    37
    Likes Received:
    1
    So what's the issue?
     
  4. Cold

    Cold Member

    Joined:
    May 1, 2022
    Messages:
    27
    Likes Received:
    0
    When it checks on inventory click it says you can’t use %arg-1% in execute console command
     
  5. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    145
    Likes Received:
    5
    Code (Text):
    1. command /kontrol [<offline player>]:
    2.     aliases: k, kon, styr, staff
    3.     permission: staff
    4.     permission message: &8&l[ &c&lSTAFF &8&l] &cDette kan du ikke!"
    5.     trigger:
    6.         if arg-1 is set:
    7.             set {target_player.%player%} to arg 1
    8.             set metadata tag "StaffGUI" of player to chest inventory with 5 rows named "&c&lKontroler"
    9.             set slot 0,1,2,3,4,5,6,7,8,36,37,38,39,41,42,43 and 44 of metadata tag "StaffGUI" of player to white stained glass pane named "&5&l"
    10.             set slot 20 of metadata tag "StaffGUI" of player to string named "" with lore ""
    11.             set slot 22 of metadata tag "StaffGUI" of player to stick named "" with lore ""
    12.             set slot 24 of metadata tag "StaffGUI" of player to shiny tnt named "&4&lSTRAF &6%arg-1%" with lore "&7Klik for at straffe &6%arg-1%!"
    13.             set slot 40 of metadata tag "StaffGUI" of player to redstone torch named "&c&lINDSTILLINGER" with lore "&f"
    14.             open (metadata tag "StaffGUI" of player) to player
    15.         else:
    16.             send "&8&l[ &c&lSTAFF &8&l] &7Du skal skrive en person!" to player
    17.  
    18. on inventory click:
    19.     name of player's current inventory = "&c&lKontroler":
    20.         cancel event
    21.         clicked slot = 24:
    22.             set {target_player.%player%} to ({target_player.%player%} parsed as offline player)
    23.             straf(player, {target_player.%player%})
    24.  
    25. function straf(player1: player, player2: player):
    26.             set metadata tag "StrafGUI" of {_player1} to chest inventory with 5 rows named "&c&lKontroler &6{_player2}"
    27.             set slot 0,1,2,3,4,5,6,7,8,36,37,38,39,41,42,43 and 44 of metadata tag "StrafGUI" of {_player1} to white stained glass pane named "&5&l"
    28.             set slot 20 of metadata tag "StrafGUI" of {_player1} to string named "&c&lKICK" with lore "&7Klik for at straffe &6{_player2}!"
    29.             set slot 22 of metadata tag "StrafGUI" of {_player1} to stick named "&3&lMUTE" with lore "&7Klik for at straffe &6{_player2}!"
    30.             set slot 24 of metadata tag "StrafGUI" of {_player1} to shiny tnt named "&4&lBAN &6{_player2}" with lore "&7Klik for at straffe &6{_player2}!"
    31.             set slot 40 of metadata tag "StrafGUI" of {_player1} to redstone torch named "&c&lINDSTILLINGER" with lore "&f"
    32.             open (metadata tag "StrafGUI" of {_player1}) to {_player1}
     
  6. Cold

    Cold Member

    Joined:
    May 1, 2022
    Messages:
    27
    Likes Received:
    0
    Thanks a lot again
     
  7. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    You could have also replaced that line with
    Code (Text):
    1. execute player command "/straf %player%"
     
  8. Cold

    Cold Member

    Joined:
    May 1, 2022
    Messages:
    27
    Likes Received:
    0
    Yea that’s true
     
Thread Status:
Not open for further replies.

Share This Page

Loading...