Solved Replace every gui slot with item???

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

VojaFTW

Member
Jun 10, 2017
42
2
0
Are is possible to apply a item to whole gui when open becouse i'm coding a free sign skript and i need that to replace whole 3 row chest with item from sign line 2.
ex: if i write second sign line: stone to whole gui of that sign when i rightclick be stone.
Gui get oppened but nothing is in him.

my code:

code_language.skript:
on rightclick on sign:
    if line 1 of event-block contains "Free":
        set line 1 of event-block to "&3[&cFree&3]"
        set {_item} to "%{freesign::item::%uncolored line 2 of event-block%}%"
        wait 1 tick
        open chest with 3 rows named "Free" to player
        set {_slot} to 27
        wait 2 tick
        set slot {_slot} of player's current inventory to {_item}
 
you need to parse the text as an item. this should maybe work
code_language.skript:
on rightclick on sign:
    if line 1 of event-block contains "Free":
        set line 1 of event-block to "&3[&cFree&3]"
        set {_item} to "%{freesign::item::%uncolored line 2 of event-block%}%" parsed as item
        wait 1 tick
        open chest with 3 rows named "Free" to player
        set {_slot} to 0
        loop 27 times:
            set slot {_slot} of player's current inventory to {_item}
            add 1 to {_slot}
 
you need to parse the text as an item. this should maybe work
code_language.skript:
on rightclick on sign:
    if line 1 of event-block contains "Free":
        set line 1 of event-block to "&3[&cFree&3]"
        set {_item} to "%{freesign::item::%uncolored line 2 of event-block%}%" parsed as item
        wait 1 tick
        open chest with 3 rows named "Free" to player
        set {_slot} to 0
        loop 27 times:
            set slot {_slot} of player's current inventory to {_item}
            add 1 to {_slot}

thank you, i try it.
EDIT: i write sign and second line is "stone" or "1" and gui is empty
 
Last edited:
thank you, i try it.
EDIT: i write sign and second line is "stone" or "1" and gui is empty
Im guessing there's something wrong with the variable {freesign::item::%uncolored line 2 of event-block%}. Not sure where you set that but why dont you just set {_item} to "%uncolored line 2 of event-block%" parsed as a item
 
Im guessing there's something wrong with the variable {freesign::item::%uncolored line 2 of event-block%}. Not sure where you set that but why dont you just set {_item} to "%uncolored line 2 of event-block%" parsed as a item

Its working i just change variable to uncolored line 2 of event block and its working, thank you
 
Status
Not open for further replies.