Make items undropable

  • 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.

Yodexx

Member
Jun 13, 2020
19
0
1
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:
on drop:
     if player's tool is compass:
          if name of player's tool is "Games:":
               cancel event

No errors, but was still dropable... ?
How can I fix this?
 
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:"
 
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?
 
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?
A tip of what to do, is use debug messages to see how far you get:
Code:
on drop:
     message "%player's tool%"
     if player's tool is compass:
          message "%name of player's tool%"
          if name of player's tool is "Games:":
               message "cancel event"
               cancel event

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
 
Status
Not open for further replies.