Skript to not lose specific item after death

  • 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 community!

    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.

Linux4343

Member
Jul 18, 2021
1
0
1
Hello all,

I would like to prevent a certain item from dropping on death. For example if players inventory contains a clock on death of player do not drop the clock on the ground (but drop all other items).

I have tried:

on death of player:
remove clock from drops

on death of player:
remove clock from victim's inventory

But have had no success. Help is much appreciated
Thanks!
 
There's probably a better way to do this but the only thing I can tell you to do is allow keepinventory on your server and then do this:
Code:
on death:
    if victim is a player:
        set {_c} to amount of clock in victim's inventory
        clear victim's inventory
        give {_c} of clock to victim
The only negative about this is that it won't give them the clock in the same inventory slot as they had it before they died, but if you don't mind that then this should work fine.
Hello all,

I would like to prevent a certain item from dropping on death. For example if players inventory contains a clock on death of player do not drop the clock on the ground (but drop all other items).

I have tried:

on death of player:
remove clock from drops

on death of player:
remove clock from victim's inventory

But have had no success. Help is much appreciated
Thanks!
 
Status
Not open for further replies.