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 out 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 Kitpvp gui help

Discussion in 'Skript' started by Jeelzz, Apr 6, 2020.

Thread Status:
Not open for further replies.
  1. Jeelzz

    Jeelzz Member

    Joined:
    Apr 6, 2020
    Messages:
    2
    Likes Received:
    0
    Hello! I'm a returning skript veteran, and I need a little help getting my head around function guis.
    Could someone give me an example or extract of a kitpvp gui, with functions.

    E.g format slot 10 of player with stone sword to run function (warrior, p:emoji_stuck_out_tongue:layer)

    function(warrior):
    give 1 of stone sword to {_p}


    What would be the correct syntax?

     
  2. Best Answer:
    Post #5 by HiqqhFive, Apr 7, 2020
  3. oHeckGage

    oHeckGage Active Member

    Joined:
    Mar 24, 2020
    Messages:
    105
    Likes Received:
    5
    It would be much easier to just use a normal..
    Code (Text):
    1. format gui slot 10 of player with stone sword to run:
    2.   give player stone sword
    3.  
     
  4. Jeelzz

    Jeelzz Member

    Joined:
    Apr 6, 2020
    Messages:
    2
    Likes Received:
    0
    Yes, but if I specifically wanted to use functions for it, how would I go about that?
     
  5. oHeckGage

    oHeckGage Active Member

    Joined:
    Mar 24, 2020
    Messages:
    105
    Likes Received:
    5

    Before posting a thread on the forums, search the docs.
     
  6. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    Hey, try this.

    Code (Text):
    1. function giveSword(p: player):
    2.     add 1 stone sword named "Yay" to {_p}'s inventory
    3.     send "Really cool" to {_p}
    4.  
    5. command /test:
    6.     trigger:
    7.         open chest with 1 row named "TEST" to player
    8.         wait a tick
    9.         set slot 0 of player's current inventory to stone sword named "Click" with lore "and you will recieve it."
    10.        
    11. on inventory click:
    12.     inventory name of player's current inventory is "TEST":
    13.         cancel event
    14.         clicked item's name contains "Click":
    15.             giveSword(player)
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...