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.

Skript GUI

Discussion in 'Skript' started by Riknesh, Jan 4, 2019.

Tags:
Thread Status:
Not open for further replies.
  1. Riknesh

    Riknesh Well-Known Member

    Joined:
    Jun 9, 2017
    Messages:
    66
    Likes Received:
    2
    Are there any addons that will be able to create custom gui other than SkQuery and TusKe?
     
  2. DieHollander_

    DieHollander_ Well-Known Member

    Joined:
    Mar 25, 2018
    Messages:
    165
    Likes Received:
    12
    You don't need any addon for that, you can just use vanilla skript
     
  3. Riknesh

    Riknesh Well-Known Member

    Joined:
    Jun 9, 2017
    Messages:
    66
    Likes Received:
    2
    i know...but can i use functions in the gui?
     
  4. DieHollander_

    DieHollander_ Well-Known Member

    Joined:
    Mar 25, 2018
    Messages:
    165
    Likes Received:
    12
    You can use the event "on inventory click:" to detect when a player is clicking on an item
     
  5. B

    Brok3nmind Well-Known Member

    Joined:
    Feb 3, 2017
    Messages:
    62
    Likes Received:
    1
    You can also use functions but i think only with a addon
     
  6. SpinKnight

    Supporter

    Joined:
    May 24, 2017
    Messages:
    30
    Likes Received:
    0
    Here's a little example for vanilla GUIs
    Code (Skript):
    1. command inv:
    2.     trigger:
    3.         open chest inventory with 3 rows named "&f&lVanilla GUI" to player
    4.         set slot 1 of player's current inventory to diamond named "test"
    5.         set slot 7 of player's current inventory to emerlad named "test"
    6.        
    7. inventory click:
    8.     name of player's current inventory is "&f&lVanilla GUI"
    9.     clicked inventory isn't player's inventory
    10.     if clicked slot is 1 or 7:
    11.         send "you clicked on: %clicked item%"
    12.     else:
    13.         send "you clicked on no item"
     
  7. Runakai1

    Runakai1 Well-Known Member

    Joined:
    Apr 27, 2018
    Messages:
    377
    Likes Received:
    20
    Code (Skript):
    1.  
    2. command /test:
    3.     trigger:
    4.         open chest with 4 rows named "test" to player
    5.         openinv(player)
    6.        
    7. function openinv(p: player):
    8.     set {_s} to 0
    9.     loop 36 times:
    10.         set slot {_s} of {_p}'s current inventory to stone named "hello"
    11.         add 1 to {_s}
    12.        
    13. on inventory click:
    14.     event-inventory is not player's inventory:
    15.         name of player's current inventory is "test":
    16.             cancel event
    17.            
    18.  
     
Thread Status:
Not open for further replies.
Loading...