Solved Giving Variable not Working

  • 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.
Apr 7, 2020
2
0
1
23
Im trying to create a crate system. What i want it to do is when clicked on it gives you a random element from a list variable.

Code:
on right click on lime stained glass:
    if player is holding a tripwire hook:
        cancel event
        clear {list::*}
        add "stone" to {list::*}
        add "hay block" to {list::*}
        set {item} to a random element of {list::*}
        give {item} to player
        remove tripwire hook from player's inventory
        send "%{item}%"

When i do this is takes the tripwire hook, but doesnt give anything. Any help would be Good!
[doublepost=1613965834,1613946156][/doublepost]turns out i needed to do this -
Code:
       give "%{item}%" parsed as item type to player
 
Status
Not open for further replies.