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 our 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 Player GUI

Discussion in 'Skript' started by Kick Maassen, Sep 13, 2019 at 9:14 AM.

  1. K

    Kick Maassen Member

    Joined:
    Friday
    Messages:
    3
    Likes Received:
    0
    Hello there,
    I am currently making a player management GUI for a survival server. I started on the punishing part but I have a problem. I first made a command with arg1 as playername but I found out that if I then try to use arg1 in the on inventory click part it doesn't work! I am kind of new to skript and its hard to find I good solution I hope you guys can help me!

    Thanks in advance!

    Code (Text):
    1. command /player [<offlineplayer>]:
    2.     permission: playercommand
    3.     trigger:
    4.         if arg 1 is not set:
    5.             send "&8[&cPlayerMenu&8] &fPlease specify a player name!"
    6.         if arg 1 is set:
    7.             open chest with 3 rows named "&8[&cPlayerMenu&8]" to player
    8.             wait 1 tick
    9.             set slot 11 of player's current inventory to barrier named "&cPunish"
    10.             set slot 12 of player's current inventory to barrier named "&aRanks"
    11.             set slot 13 of player's current inventory to barrier named "&5Open player's inventory"
    12.             set slot 14 of player's current inventory to barrier named "&eTeleport to player"
    13.             set slot 15 of player's current inventory to barrier named "&2&lLandlord"
    14.             set slot 16 of player's current inventory to barrier named "&3"
    15.             set slot 17 of player's current inventory to barrier named "&aDisclaimer:" with lore "&fFor some staff-members some functions may not apply since they are not the proper rank to execute the function."
    16.  
    17. on inventory click:
    18.     if inventory name of player's current inventory is "&8[&cPlayerMenu&8]":
    19.         if clicked slot is 11:
    20.             open chest with 3 rows named "&cPunish" to player
    21.             wait 1 tick
    22.             set slot 11 of player's current inventory to barrier named "&cMute"
    23.             set slot 13 of player's current inventory to barrier named "&cKick"
    24.             set slot 15 of player's current inventory to barrier named "&cBan"
    25.             set slot 17 of player's current inventory to barrier named "&cIp-Ban"
    26.     if inventory name of player's current inventory is "&cPunish":
    27.         if clicked slot is 11:
    28.             open chest with 3 rows named "&cMute reason" to player
    29.             wait 1 tick
    30.             set slot 11 of player's current inventory to barrier named "&cSpam"
    31.             set slot 13 of player's current inventory to barrier named "&cTargeted disrescpect"
    32.             set slot 15 of player's current inventory to barrier named "&cIllegal Advertisement"
    33.             set slot 17 of player's current inventory to barrier named "&cAdvertisement of in-game items or websites that are inappropriate according to the Minecraft EULA"
    34.     if inventory name of player's current inventory is "&cMute reason":
    35.         if clicked slot is 11:
    36.             make player execute command "/mute %arg 1% 3h Spam"
    37.         if clicked slot is 13:
    38.             make player execute command "/mute %arg 1% 1day Targeted disrespect"
    39.         if clicked slot is 15:
    40.             make player execute command "/mute %arg 1% 6h Illegal Advertisement"
    41.         if clicked slot is 17:
    42.             make player execute command "/mute %arg 1% 6days Advertisement of in-game items or websites that are inappropriate according to the Minecraft EULA"
    43.     if inventory name of player's current inventory is "&cPunish":
    44.         if clicked slot is 13:
    45.             open chest with 3 rows named "&cKick reason" to player
    46.             wait 1 tick
    47.             set slot 11 of player's current inventory to barrier named "&cPlayer is clitching out"
    48.             set slot 13 of player's current inventory to barrier named "&cPlayer needs to be removed from server"
    49.             set slot 15 of player's current inventory to barrier named "&cPlayer is currently in a illegal position"
    50.             set slot 17 of player's current inventory to barrier named "&cOther"
    51.     if inventory name of player's current inventory is "&cKick reason":
    52.         if clicked slot is 11:
    53.             make player execute command "/kick %arg 1% You were clitching out -s"
    54.         if clicked slot is 13:
    55.             make player execute command "/kick %arg 1% A staff-member found that you needed to be removed from the server -s"
    56.         if clicked slot is 15:
    57.             make player execute command "/kick %arg 1% You were in a illegal position -s"
    58.         if clicked slot is 17:
    59.             make player execute command "/kick %arg 1% Kicked for an unknown reason -s"
    60.     if inventory name of player's current inventory is "&cPunish":
    61.         if clicked slot is 15:
    62.             open chest with 3 rows named "&cBan reason" to player
    63.             wait 1 tick
    64.             set slot 11 of player's current inventory to barrier named "&cMalicious Hacks"
    65.             set slot 12 of player's current inventory to barrier named "&cNon-Malicious Hacks"
    66.             set slot 13 of player's current inventory to barrier named "&cIntentionally making the server crash"
    67.             set slot 14 of player's current inventory to barrier named "&cBug-abuse"
    68.             set slot 15 of player's current inventory to barrier named "&cAbuse of any kind while in a staff or Builder position"
    69.             set slot 16 of player's current inventory to barrier named "&cSpam third offense"
    70.             set slot 17 of player's current inventory to barrier named "&cOther"
    71.     if inventory name of player's current inventory is "&cBan reason":
    72.         if clicked slot is 11:
    73.             make player execute command "/ban %arg 1% 25days Malicious Hacks"
    74.         if clicked slot is 12:
    75.             make player execute command "/ban %arg 1% 7days Non-Malicious Hacks"
    76.         if clicked slot is 13:
    77.             make player execute command "/ban %arg 1% 25days Trying to let the server crash"
    78.         if clicked slot is 14:
    79.             make player execute command "/ban %arg 1% 2days Bug-Abuse"
    80.         if clicked slot is 15:
    81.             make player execute command "/ban %arg 1% Abuse of any kind while in a staff or builder position"
    82.         if clicked slot is 16:
    83.             make player execute command "/ban %arg 1% 4days Spam third offense"
    84.         if clicked slot is 17:
    85.             open chest with 3 rows named "&cDuration" to player
    86.             wait 1 tick
    87.             set slot 11 of player's current inventory to barrier named "&c3 Hours"
    88.             set slot 12 of player's current inventory to barrier named "&c12 Hours"
    89.             set slot 13 of player's current inventory to barrier named "&c1 Day"
    90.             set slot 14 of player's current inventory to barrier named "&c3 Days"
    91.             set slot 15 of player's current inventory to barrier named "&c10 Days"
    92.             set slot 16 of player's current inventory to barrier named "&c25 Days"
    93.             set slot 17 of player's current inventory to barrier named "&cPERM"
    94.     if inventory name of player's current inventory is "&cDuration":
    95.         if clicked slot is 11:
    96.             make player execute command "/ban %arg 1% 3hours"
    97.         if clicked slot is 12:
    98.             make player execute command "/ban %arg 1% 12hours"
    99.         if clicked slot is 13:
    100.             make player execute command "/ban %arg 1% 1day"
    101.         if clicked slot is 14:
    102.             make player execute command "/ban %arg 1% 3days"
    103.         if clicked slot is 15:
    104.             make player execute command "/ban %arg 1% 10days"
    105.         if clicked slot is 16:
    106.             make player execute command "/ban %arg 1% 25days"
    107.         if clicked slot is 17:
    108.             make player execute command "/ban %arg 1%"
    --- Double Post Merged, Sep 13, 2019 at 9:21 AM, Original Post Date: Sep 13, 2019 at 9:14 AM ---

    Skript version: 2.4-beta5
    Skript Author:
    bensku
    Minecraft Version: 1.14.4

    (forgot to add this)

     
    #1 Kick Maassen, Sep 13, 2019 at 9:21 AM
    Last edited: Sep 13, 2019 at 10:36 AM
  2. Best Answer:
    Post #4 by Orodude, Sep 13, 2019 at 10:47 AM
  3. Amar_Pro_gamer

    Joined:
    May 31, 2018
    Messages:
    5
    Likes Received:
    0
    to know your skript version, you use the command /ver skript.
    for the skript author, it should display the author, not you, either the one who made the skript plugin (Njol) or the one who maintains it. (Bensku.)
     
    #2 Amar_Pro_gamer, Sep 13, 2019 at 10:26 AM
    Last edited: Sep 13, 2019 at 10:42 AM
  4. K

    Kick Maassen Member

    Joined:
    Friday
    Messages:
    3
    Likes Received:
    0
  5. Orodude

    Orodude Member

    Joined:
    Oct 6, 2017
    Messages:
    1
    Likes Received:
    0
    The expression arg 1 is only referring to the input of your command. Simply save your argument to a variable and reference the variable in your 'make player execute...' lines instead of arg 1. Hope this helps!
     
  6. K

    Kick Maassen Member

    Joined:
    Friday
    Messages:
    3
    Likes Received:
    0
Loading...