Remove item with specific lore

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

MrVlamis

Member
Apr 27, 2022
11
0
1
19
Hey, I have a question, how can I implement this?

how is it possible that certain items are deleted after death? e.g. an item with the lore "can get lose" is deleted after death as well as items without lore and items with the lore "can keep" cannot be lost.
 
On death, check if the drops contain the items you want the player to keep and remove them, then give them back once the player respawns.
 
on death:
cancel event:
loop player's inventory:
if lore of loop-value is "can lose":
remove loop-value from player's inventory
kill player
[doublepost=1651088702,1651088668][/doublepost]
on death:
cancel event:
loop player's inventory:
if lore of loop-value is "can lose":
remove loop-value from player's inventory
kill player
with all spaces required
 
Code:
on death:
    add drops where [input's lore is "not lost on death"] to {drops::%player%::*} #adds items with lore "not lost on death" to the list
    remove {drops::%player%::*} from drops #removes the items from the drops
   
on respawn:
    if {drops::%player%::*} is set: #checks if the player had items with lore "not lost on death"
        add {drops::%player%::*} to player #gives the items
        delete {drops::%player%::*} #deletes the list of items
 
  • Like
Reactions: Jayden13O
Status
Not open for further replies.