Metadata

  • 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 community!

    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.

Sythical

Member
Sep 7, 2020
2
0
1
Hello.
I am currently trying to make a generator skript where when you shift right click a generator, the type of generator is set to a metadata tag, and then when you click to upgrade it, if the block from the metadata tag is a hay bale, if the player has a balance greater than 5000, it sets the generator to a pumpkin one for example.
This is what I currently have, and when I click on the 13th slot in the gui, it says "<none>" when it should say "Hay Bale"

Code:
on right click on hay block:
    if player is sneaking:
        if {wheatgen::%location of event-block%} is player's uuid:
            upgradeGUI(player)
            set metadata tag "upgradeBlock" of event-block to {_block}

on inventory click:
    if event-inventory = (metadata tag "upgradeGUI" of player):
        cancel event
        if index of event-slot is 13:
            broadcast "%{_block}%"

EDIT:
I have figured out how to make it check if the block is a hay block or not, but now, when I place down a hay block and I click on the slot, it says "It's a hay block", but then when I place down another generator, it also says "It's a hay block". So then, when I break both of the gens, and place a gen that is not a hay block first, it says "It's not a hay block" and then when I place a hay block, it says "It's not a hay block". Any ideas how to fix this?


Code:
on right click on hay block:
    if player is sneaking:
        if {wheatgen::%location of event-block%} is player's uuid:
            upgradeGUI(player)
            set metadata tag "upgradeBlock" of {hi} to {_block}
        else:
            cancel event
            send "lol no" to player
    else:
        send "&cYou need to be sneaking to upgrade this generator."

on right click on pumpkin:
    if player is sneaking:
        if {pumpkingen::%location of event-block%} is player's uuid:
            upgradeGUI(player)
            set metadata tag "upgradeBlock" of player to {_block}
        else:
            cancel event
            send "lol no" to player
    else:
        send "&cYou need to be sneaking to upgrade this generator."

on inventory click:
    if event-inventory = (metadata tag "upgradeGUI" of player):
        cancel event
        if index of event-slot is 13:
            set {_block} to metadata tag "upgradeBlock" of player
            if {_block} is a hay block:
                send "&a&lIT'S A HAY BLOCK!!"
            else:
                send "&c&lIT IS NOT A HAY BLOCK!"
EDIT 2:
Now it doesn't send anything lol..
[doublepost=1604335036,1604239989][/doublepost]Can anyone help?? lol
 
Status
Not open for further replies.