Solved Player GUI

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

Kick Maassen

Member
Sep 13, 2019
3
0
1
33
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:
command /player [<offlineplayer>]:
    permission: playercommand
    trigger:
        if arg 1 is not set:
            send "&8[&cPlayerMenu&8] &fPlease specify a player name!"
        if arg 1 is set:
            open chest with 3 rows named "&8[&cPlayerMenu&8]" to player
            wait 1 tick
            set slot 11 of player's current inventory to barrier named "&cPunish"
            set slot 12 of player's current inventory to barrier named "&aRanks"
            set slot 13 of player's current inventory to barrier named "&5Open player's inventory"
            set slot 14 of player's current inventory to barrier named "&eTeleport to player"
            set slot 15 of player's current inventory to barrier named "&2&lLandlord"
            set slot 16 of player's current inventory to barrier named "&3"
            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."

on inventory click:
    if inventory name of player's current inventory is "&8[&cPlayerMenu&8]":
        if clicked slot is 11:
            open chest with 3 rows named "&cPunish" to player
            wait 1 tick
            set slot 11 of player's current inventory to barrier named "&cMute"
            set slot 13 of player's current inventory to barrier named "&cKick"
            set slot 15 of player's current inventory to barrier named "&cBan"
            set slot 17 of player's current inventory to barrier named "&cIp-Ban"
    if inventory name of player's current inventory is "&cPunish":
        if clicked slot is 11:
            open chest with 3 rows named "&cMute reason" to player
            wait 1 tick
            set slot 11 of player's current inventory to barrier named "&cSpam"
            set slot 13 of player's current inventory to barrier named "&cTargeted disrescpect"
            set slot 15 of player's current inventory to barrier named "&cIllegal Advertisement"
            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"
    if inventory name of player's current inventory is "&cMute reason":
        if clicked slot is 11:
            make player execute command "/mute %arg 1% 3h Spam"
        if clicked slot is 13:
            make player execute command "/mute %arg 1% 1day Targeted disrespect"
        if clicked slot is 15:
            make player execute command "/mute %arg 1% 6h Illegal Advertisement"
        if clicked slot is 17:
            make player execute command "/mute %arg 1% 6days Advertisement of in-game items or websites that are inappropriate according to the Minecraft EULA"
    if inventory name of player's current inventory is "&cPunish":
        if clicked slot is 13:
            open chest with 3 rows named "&cKick reason" to player
            wait 1 tick
            set slot 11 of player's current inventory to barrier named "&cPlayer is clitching out"
            set slot 13 of player's current inventory to barrier named "&cPlayer needs to be removed from server"
            set slot 15 of player's current inventory to barrier named "&cPlayer is currently in a illegal position"
            set slot 17 of player's current inventory to barrier named "&cOther"
    if inventory name of player's current inventory is "&cKick reason":
        if clicked slot is 11:
            make player execute command "/kick %arg 1% You were clitching out -s"
        if clicked slot is 13:
            make player execute command "/kick %arg 1% A staff-member found that you needed to be removed from the server -s"
        if clicked slot is 15:
            make player execute command "/kick %arg 1% You were in a illegal position -s"
        if clicked slot is 17:
            make player execute command "/kick %arg 1% Kicked for an unknown reason -s"
    if inventory name of player's current inventory is "&cPunish":
        if clicked slot is 15:
            open chest with 3 rows named "&cBan reason" to player
            wait 1 tick
            set slot 11 of player's current inventory to barrier named "&cMalicious Hacks"
            set slot 12 of player's current inventory to barrier named "&cNon-Malicious Hacks"
            set slot 13 of player's current inventory to barrier named "&cIntentionally making the server crash"
            set slot 14 of player's current inventory to barrier named "&cBug-abuse"
            set slot 15 of player's current inventory to barrier named "&cAbuse of any kind while in a staff or Builder position"
            set slot 16 of player's current inventory to barrier named "&cSpam third offense"
            set slot 17 of player's current inventory to barrier named "&cOther"
    if inventory name of player's current inventory is "&cBan reason":
        if clicked slot is 11:
            make player execute command "/ban %arg 1% 25days Malicious Hacks"
        if clicked slot is 12:
            make player execute command "/ban %arg 1% 7days Non-Malicious Hacks"
        if clicked slot is 13:
            make player execute command "/ban %arg 1% 25days Trying to let the server crash"
        if clicked slot is 14:
            make player execute command "/ban %arg 1% 2days Bug-Abuse"
        if clicked slot is 15:
            make player execute command "/ban %arg 1% Abuse of any kind while in a staff or builder position"
        if clicked slot is 16:
            make player execute command "/ban %arg 1% 4days Spam third offense"
        if clicked slot is 17:
            open chest with 3 rows named "&cDuration" to player
            wait 1 tick
            set slot 11 of player's current inventory to barrier named "&c3 Hours"
            set slot 12 of player's current inventory to barrier named "&c12 Hours"
            set slot 13 of player's current inventory to barrier named "&c1 Day"
            set slot 14 of player's current inventory to barrier named "&c3 Days"
            set slot 15 of player's current inventory to barrier named "&c10 Days"
            set slot 16 of player's current inventory to barrier named "&c25 Days"
            set slot 17 of player's current inventory to barrier named "&cPERM"
    if inventory name of player's current inventory is "&cDuration":
        if clicked slot is 11:
            make player execute command "/ban %arg 1% 3hours"
        if clicked slot is 12:
            make player execute command "/ban %arg 1% 12hours"
        if clicked slot is 13:
            make player execute command "/ban %arg 1% 1day"
        if clicked slot is 14:
            make player execute command "/ban %arg 1% 3days"
        if clicked slot is 15:
            make player execute command "/ban %arg 1% 10days"
        if clicked slot is 16:
            make player execute command "/ban %arg 1% 25days"
        if clicked slot is 17:
            make player execute command "/ban %arg 1%"
[doublepost=1568362894,1568362496][/doublepost]
Skript version: 2.4-beta5
Skript Author:
bensku
Minecraft Version: 1.14.4

(forgot to add this)
 
Last edited:
Skript Version (do not put latest): I dont really know
Skript Author:
Me
Minecraft Version: 1.14.4

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.)
 
Last edited:
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!
 
Status
Not open for further replies.