How to remove specific lore of a item?

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

Bell O'dell

Member
Nov 19, 2022
10
0
1
44
I want to remove the lore "SoulBound I" after death without setting it to blank or just like deleting the last line of the lore. How do I do this?
 

Attachments

  • soulbound.sk
    204 bytes · Views: 90
This should work:
Code:
#Delete last line
set {_s} to size of lore of loop-item
delete line {_s} of lore of loop-item
 
Hmm, I can’t test if this works at the moment, but perhaps you can try to save the item as a (temp) variable, i.e.
Code:
set {_item} to loop-item
Then change the lore of that.

If that doesn’t work, then I’m not really sure haha
 
Hmm, I can’t test if this works at the moment, but perhaps you can try to save the item as a (temp) variable, i.e.
Code:
set {_item} to loop-item
Then change the lore of that.

If that doesn’t work, then I’m not really sure haha
nope
same error
 
nope
same error
Are you sure? This returns no errors for me:
Code:
on death of player:
    loop drops:
        if lore of loop-item contains "&7Soulbound I":
            remove loop-item from drops
            set {_i} to loop-item
            set {_s} to size of lore of {_i}
            delete line {_s} of lore of {_i}
            wait 5 ticks
            add {_s} to victim's inventory
 
Are you sure? This returns no errors for me:
Code:
on death of player:
    loop drops:
        if lore of loop-item contains "&7Soulbound I":
            remove loop-item from drops
            set {_i} to loop-item
            set {_s} to size of lore of {_i}
            delete line {_s} of lore of {_i}
            wait 5 ticks
            add {_s} to victim's inventory
ok it has no errors but when I respawn the items are gone.
 
ok it has no errors but when I respawn the items are gone.
Does it still happen when nothing is done to the lore of the item?
Code:
on death of player:
    loop drops:
        if lore of loop-item contains "&7Soulbound I":
            remove loop-item from drops
            wait 5 ticks
            add loop-item to victim's inventory
 
Does it still happen when nothing is done to the lore of the item?
Code:
on death of player:
    loop drops:
        if lore of loop-item contains "&7Soulbound I":
            remove loop-item from drops
            wait 5 ticks
            add loop-item to victim's inventory
no the dropped item doesnt have removed lore.
 
no the dropped item doesnt have removed lore.

It's because they put 5 ticks delay directly into loop. Try this:
Code:
on death of player:
    loop drops:
        if lore of loop-item contains "&7Soulbound I":
            remove loop-item from drops
            set {_i} to loop-item
            set {_s} to size of lore of {_i}
            delete line {_s} of lore of {_i}
            add {_i} to {_to.give}
    wait 5 ticks
    add {_to.give} to victim's inventory
 
It's because they put 5 ticks delay directly into loop. Try this:
Code:
on death of player:
    loop drops:
        if lore of loop-item contains "&7Soulbound I":
            remove loop-item from drops
            set {_i} to loop-item
            set {_s} to size of lore of {_i}
            delete line {_s} of lore of {_i}
            add {_i} to {_to.give}
    wait 5 ticks
    add {_to.give} to victim's inventory
Now there is no dropped item or item in my inventory.
 
Now there is no dropped item or item in my inventory.

Whoops.. forgot to make it array variable:
Code:
on death of player:
    loop drops:
        if lore of loop-item contains "&7Soulbound I":
            remove loop-item from drops
            set {_i} to loop-item
            set {_s} to size of lore of {_i}
            delete line {_s} of lore of {_i}
            add {_i} to {_to.give::*}
    wait 5 ticks
    add {_to.give::*} to victim's inventory
 
Whoops.. forgot to make it array variable:
Code:
on death of player:
    loop drops:
        if lore of loop-item contains "&7Soulbound I":
            remove loop-item from drops
            set {_i} to loop-item
            set {_s} to size of lore of {_i}
            delete line {_s} of lore of {_i}
            add {_i} to {_to.give::*}
    wait 5 ticks
    add {_to.give::*} to victim's inventory
works
 
Whoops.. forgot to make it array variable:
Code:
on death of player:
    loop drops:
        if lore of loop-item contains "&7Soulbound I":
            remove loop-item from drops
            set {_i} to loop-item
            set {_s} to size of lore of {_i}
            delete line {_s} of lore of {_i}
            add {_i} to {_to.give::*}
    wait 5 ticks
    add {_to.give::*} to victim's inventory
Never mind. It's inconsistent and when it does work sometimes it removes the wrong lore.
 
Status
Not open for further replies.