Solved Functions in GUIs using TuSKE

  • 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.

jeelzzz

Member
Oct 19, 2019
3
0
1
27
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:
command /h:
    trigger:
        open virtual chest inventory with 6 rows named "&bShop" to player
        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:
function openSelection(selection: item, amount: number, price: number, buyer: player):
    wait 2 ticks
    open chest with 6 rows named "&bRevamped Shop" to {_buyer}
    initBorder({_buyer})
    set {scaledPrice} to {_price} * {_amount}
    set {itemPlusAmount} to "%{_amount}% %{_selection}%"
    set {iap} to {itemPlusAmount} parsed as item
    format gui slot 13 of {_buyer} with {iap} named "&aBuy" with lore "&f$%{scaledPrice}%" to close then run [buy({_buyer}, {scaledPrice}, {_selection}, {_amount})]
    format gui slot 28 of {_buyer} with red stained glass pane named "&cSet to 1" to close then run [openSelection({_selection}, 1, {_price}, {_buyer})]
 
Code:
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)
 
Status
Not open for further replies.