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 Two questions, Skript

Discussion in 'Skript' started by xGrow, Feb 26, 2017.

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

    xGrow Member

    Joined:
    Feb 26, 2017
    Messages:
    10
    Likes Received:
    1
    1º Question:
    How i can know what was a player's tools what the player was using to cancel drop or clear drop?:
    Like this:
    Code (Skript):
    1. on drop:
    2.     if player's tool is a bowl:
    3.         wait 5 ticks
    4.         clear dropped items
    2º Question:
    How i can put a number of items in variable to give a player when he join:
    Like this:
    Code (Skript):
    1. on join:
    2.     if {lc.nmr.%player%} is more or equal to 1:
    3.         set slot 1 of player to {lc.nmr.%player%} trapped chest named "&c&lLoot Crate"
    Error:
    Code (Skript):
    1. a slot can't be set to '{lc.nmr.%player%} trapped chest named "&c&lLoot Crate"' because the latter is neither an item type nor an item stack (kits.sk, line 321: set slot 1 of player to {lc.nmr.%player%} trapped chest named "&c&lLoot Crate"')
     
  2. Best Answer:
    Post #2 by ShaneBee, Feb 26, 2017
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Use the expression: "%dropped item%", to find out which item was dropped. If you want to delete the dropped item, then you can use the effect "delete dropped item".

    Here is an example:
    Code (Skript):
    1.  
    2. on drop:
    3.     broadcast "%dropped item%"
    4.     if dropped item is a bowl:
    5.         delete dropped item
    6.  

    Just put "of" after your variable, and it should be fixed.

    Here is an example:
    Code (Skript):
    1.  
    2. on join:
    3.     set slot 1 of player to {lc.nmr.%player%} of trapped chest named "&c&lLoot Crate"
    4.     give player {lc.nmr.%player%} of trapped chest named "&c&lLoot Crate"
    5.  
     
    • Like Like x 1
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231

    First question:
    You only need to do this
    Code (Skript):
    1. on drop:
    2.     if event-item is a bowl:
    3.         cancel event
    Second question:
    Another persons helped you.
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...