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.

Make items undropable

Discussion in 'Skript' started by Yodexx, Jul 17, 2020.

Tags:
Thread Status:
Not open for further replies.
  1. Yodexx

    Yodexx Member

    Joined:
    Jun 13, 2020
    Messages:
    19
    Likes Received:
    0
    Soo uuh... I'm trying to make a compass for my server spawn, where you can't drop it.
    And I've tried to search all over forums, docs, web etc and found nothing. :I

    So what is the best way to make items non dropable? I tried this:
    Code (Text):
    1. on drop:
    2.      if player's tool is compass:
    3.           if name of player's tool is "Games:":
    4.                cancel event
    No errors, but was still dropable... ?
    How can I fix this?
     
  2. BaeFell

    BaeFell I'm Poppy
    Admin Supporter

    Joined:
    Nov 27, 2016
    Messages:
    916
    Likes Received:
    228
    Are you 100% sure the item is called "Games:"? If the name of the item has colours in, you need to include those colour codes or use uncoloured name of player's tool is "Games:"
     
  3. Yodexx

    Yodexx Member

    Joined:
    Jun 13, 2020
    Messages:
    19
    Likes Received:
    0
    hmmm, didn't work :emoji_frowning:
    But yes, the compass is 100% called "Games:" (because I own a minigame server)

    I tried that didn't work. Modified it, that didn't work... So what can I do?
     
  4. BaeFell

    BaeFell I'm Poppy
    Admin Supporter

    Joined:
    Nov 27, 2016
    Messages:
    916
    Likes Received:
    228
    A tip of what to do, is use debug messages to see how far you get:
    Code (Text):
    1.  
    2. on drop:
    3.      message "%player's tool%"
    4.      if player's tool is compass:
    5.           message "%name of player's tool%"
    6.           if name of player's tool is "Games:":
    7.                message "cancel event"
    8.                cancel event
    9.  
    I do this for everything when my code isn't working. Break the code down into these little sections and you can see where it is failing
     
Thread Status:
Not open for further replies.

Share This Page

Loading...