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.

Solved Functions in GUIs using TuSKE

Discussion in 'Skript' started by jeelzzz, Oct 19, 2019.

  1. jeelzzz

    jeelzzz Member

    Joined:
    Oct 19, 2019
    Messages:
    3
    Likes Received:
    0
    I'm trying to make a shop gui, but it does not load the item in the gui because it does not return a value.
    My gui code:
    Code (Text):
    1. command /h:
    2.     trigger:
    3.         open virtual chest inventory with 6 rows named "&bShop" to player
    4.         format gui slot 22 of player with steak named "&6Steak" with lore "&f$100" to close then run [openSelection(steak,10,100,the player)]
    My function code:
    Code (Text):
    1.  
    2. function openSelection(selection: item, amount: number, price: number, buyer: player):
    3.     wait 2 ticks
    4.     open chest with 6 rows named "&bRevamped Shop" to {_buyer}
    5.     initBorder({_buyer})
    6.     set {scaledPrice} to {_price} * {_amount}
    7.     set {itemPlusAmount} to "%{_amount}% %{_selection}%"
    8.     set {iap} to {itemPlusAmount} parsed as item
    9.     format gui slot 13 of {_buyer} with {iap} named "&aBuy" with lore "&f$%{scaledPrice}%" to close then run [buy({_buyer}, {scaledPrice}, {_selection}, {_amount})]
    10.     format gui slot 28 of {_buyer} with red stained glass pane named "&cSet to 1" to close then run [openSelection({_selection}, 1, {_price}, {_buyer})]
     
  2. Vorze

    Vorze Well-Known Member

    Joined:
    Jul 10, 2017
    Messages:
    48
    Likes Received:
    2
    Code (Text):
    1. format gui slot 22 of player with steak named "&6Steak" with lore "&f$100" to close then run function openSelection(steak,10,100,the player)
     
  3. jeelzzz

    jeelzzz Member

    Joined:
    Oct 19, 2019
    Messages:
    3
    Likes Received:
    0
    Ah, thank you. I did not know TuSKE had a function thing you could add on.
     
  4. Vorze

    Vorze Well-Known Member

    Joined:
    Jul 10, 2017
    Messages:
    48
    Likes Received:
    2
Loading...