Kits GUI skript

Discussion in 'Skript' started by Yolo_Always_4_7, Apr 21, 2017.

  1. Hello, today I was making a skript and I just wanted to know if this was possible. To have a gui inside a gui, but without executing another command to open that secondary gui. I'm trying to make a kits gui were you click on the Member rank chest, and it opens up a gui with the kits that the Member rank has. Basically how SaiCoPvP have their /kits. Thanks for reading!
  2. You'll probably find more help on SkUnity's forums.
    • Agree Agree x 1
  3. Yes you can do this!! PM me for more detail
  4. Havent found anything yet about this :confused::confused:
  5. Using skQuery, you can use functions to check if a player has a certain "rank." For instance, I would probably write:
    Code (Text):
    format slot 0 of player with diamond named §9Diamond" with lore "Select diamond armour kit!" to close then run [do[kitFunction(player, diamond)]]
    What this code is getting the IGN and the string for it to execute a function named kitFunction.

    Now, you can create the code for kitFunction.
    Code (Text):
    function kitFunction(p: player, k: string):
        if {rank.%{_p}%} is "": #Player has default rank
            if {_k} is "diamond":
                close inventory of {_p}
                open chest with... #you know the drill.
                format slot 20 of {_p} with emerald block named "§aConfirm" to close then run [do[give whatever to {_p}
    This is a function utilizing the code (lambda) we defined earlier to give the player their kit. PM me for more.
  6. I learnt skript not long ago, but from this, I'm thinking this checks if a player has that rank, for example the diamond rank, then if the playes has the diamond rank, it will give the diamond kit? or will it open a secondary GUI if the player has the right rank?
  7. I just reread your post. If you want to have a certain player show ranked kits, this should be the appropriate code:
    Code (Text):
    format slot 0 of player with gold chestplate named "Member Kits" with lore "Show member kits." to close then run [do[kitDisplay(player, member)]]
    format slot 2 of player with diamond chestplate named "VIP Kits" with lore "Show VIP kits." to close then run [do[kitDisplay(player, vip)]]
    This will list all the "ranks" of kits that a player can choose. A function is similar to mathematics f(x) = x (and operators). What a function does is take what the input is and produces an output. Essentially, in our lambda, [do[kitDisplay(player, "rank")]], we are inputting two "parameters:" the player's name (to display what kits they have available) and the kit rank they select (for GUIception). Our example function code would be:
    Code (Text):
    function kitDisplay(p: player, r: string): #r = rank
        if {_r} is "member": #We use local variables in functions
            open chest with x rows to player named "Member Kits"
            wait 2 ticks
            #Kit listing.
        if {_r} is "vip":
            if {server.rank.%{_p}%} is "vip" or "mvp" or "mod": #etc.
                open chest with blah....
                send "Insufficient Perms!" to {_p}
    Hope this helps!
    • Useful Useful x 1