1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Giving Variable not Working

Discussion in 'Skript' started by ZombiePigmanDude, Feb 21, 2021.

Thread Status:
Not open for further replies.
  1. ZombiePigmanDude

    Joined:
    Apr 7, 2020
    Messages:
    2
    Likes Received:
    0
    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 (Text):
    1. on right click on lime stained glass:
    2.     if player is holding a tripwire hook:
    3.         cancel event
    4.         clear {list::*}
    5.         add "stone" to {list::*}
    6.         add "hay block" to {list::*}
    7.         set {item} to a random element of {list::*}
    8.         give {item} to player
    9.         remove tripwire hook from player's inventory
    10.         send "%{item}%"
    When i do this is takes the tripwire hook, but doesnt give anything. Any help would be Good!
    --- Double Post Merged, Feb 22, 2021, Original Post Date: Feb 21, 2021 ---
    turns out i needed to do this -
    Code (Text):
    1.  
    2.        give "%{item}%" parsed as item type to player
    3.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...