Skript 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.
Here's a little example for vanilla GUIs
code_language.skript:
command inv:
    trigger:
        open chest inventory with 3 rows named "&f&lVanilla GUI" to player
        set slot 1 of player's current inventory to diamond named "test"
        set slot 7 of player's current inventory to emerlad named "test"
        
inventory click:
    name of player's current inventory is "&f&lVanilla GUI"
    clicked inventory isn't player's inventory
    if clicked slot is 1 or 7:
        send "you clicked on: %clicked item%"
    else:
        send "you clicked on no item"
 
i know...but can i use functions in the gui?
code_language.skript:
command /test:
    trigger:
        open chest with 4 rows named "test" to player
        openinv(player)
       
function openinv(p: player):
    set {_s} to 0
    loop 36 times:
        set slot {_s} of {_p}'s current inventory to stone named "hello"
        add 1 to {_s}
       
on inventory click:
    event-inventory is not player's inventory:
        name of player's current inventory is "test":
            cancel event
 
Status
Not open for further replies.