Skript help

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

DogPixel

Member
Oct 4, 2020
1
0
1
27
How do I show an item a player is holding in their hand in a GUI?

(and yes, it should update in real time)
 
How do I show an item a player is holding in their hand in a GUI?

(and yes, it should update in real time)

using tuske or vanilla guis?
[doublepost=1601993136,1601992204][/doublepost]
Code:
on right click on player:
    set {showing inventory.%player%} to "%clicked player%"
    open virtual chest inventory with size 1 named "your name" to player
    
every 5 ticks:   #you can change it to 1 if you want but i did 5 to reduce lag
    loop all players:
        set {held item.%loop-player%} to loop-player's held item
        if {showing inventory.%loop-player%} is set:
            format gui slot 0 of loop-player with {held item.%{showing inventory.%loop-player%}%}
    
on inventory close:
    if {showing inventory.%player%} is set:
        delete {showing inventory.%player%}
        close player's inventory

i used tuske
 
Status
Not open for further replies.