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.

How to remove specific lore of a item?

Discussion in 'Skript' started by Bell O'dell, Nov 19, 2022.

Thread Status:
Not open for further replies.
  1. Bell O'dell

    Bell O'dell Member

    Joined:
    Nov 19, 2022
    Messages:
    10
    Likes Received:
    0
    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?
     

    Attached Files:

  2. MultiverShaun

    MultiverShaun Member

    Joined:
    Aug 8, 2022
    Messages:
    25
    Likes Received:
    2
    This should work:
    Code (Text):
    1. #Delete last line
    2. set {_s} to size of lore of loop-item
    3. delete line {_s} of lore of loop-item
     
  3. Bell O'dell

    Bell O'dell Member

    Joined:
    Nov 19, 2022
    Messages:
    10
    Likes Received:
    0
    It says I cannot delete the lore of a loop item.
     
  4. MultiverShaun

    MultiverShaun Member

    Joined:
    Aug 8, 2022
    Messages:
    25
    Likes Received:
    2
    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 (Text):
    1. set {_item} to loop-item
    Then change the lore of that.

    If that doesn’t work, then I’m not really sure haha
     
  5. Bell O'dell

    Bell O'dell Member

    Joined:
    Nov 19, 2022
    Messages:
    10
    Likes Received:
    0
    nope
    same error
     
  6. MultiverShaun

    MultiverShaun Member

    Joined:
    Aug 8, 2022
    Messages:
    25
    Likes Received:
    2
    Are you sure? This returns no errors for me:
    Code (Text):
    1. on death of player:
    2.     loop drops:
    3.         if lore of loop-item contains "&7Soulbound I":
    4.             remove loop-item from drops
    5.             set {_i} to loop-item
    6.             set {_s} to size of lore of {_i}
    7.             delete line {_s} of lore of {_i}
    8.             wait 5 ticks
    9.             add {_s} to victim's inventory
     
  7. Bell O'dell

    Bell O'dell Member

    Joined:
    Nov 19, 2022
    Messages:
    10
    Likes Received:
    0
    ok it has no errors but when I respawn the items are gone.
     
  8. MultiverShaun

    MultiverShaun Member

    Joined:
    Aug 8, 2022
    Messages:
    25
    Likes Received:
    2
    Does it still happen when nothing is done to the lore of the item?
    Code (Text):
    1. on death of player:
    2.     loop drops:
    3.         if lore of loop-item contains "&7Soulbound I":
    4.             remove loop-item from drops
    5.             wait 5 ticks
    6.             add loop-item to victim's inventory
     
  9. Bell O'dell

    Bell O'dell Member

    Joined:
    Nov 19, 2022
    Messages:
    10
    Likes Received:
    0
    no the dropped item doesnt have removed lore.
     
  10. ImOfflinezzz

    Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    76
    Likes Received:
    10
    It's because they put 5 ticks delay directly into loop. Try this:
    Code (Text):
    1.  
    2. on death of player:
    3.     loop drops:
    4.         if lore of loop-item contains "&7Soulbound I":
    5.             remove loop-item from drops
    6.             set {_i} to loop-item
    7.             set {_s} to size of lore of {_i}
    8.             delete line {_s} of lore of {_i}
    9.             add {_i} to {_to.give}
    10.     wait 5 ticks
    11.     add {_to.give} to victim's inventory
     
  11. Bell O'dell

    Bell O'dell Member

    Joined:
    Nov 19, 2022
    Messages:
    10
    Likes Received:
    0
    Now there is no dropped item or item in my inventory.
     
  12. ImOfflinezzz

    Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    76
    Likes Received:
    10
    Whoops.. forgot to make it array variable:
    Code (Text):
    1.  
    2. on death of player:
    3.     loop drops:
    4.         if lore of loop-item contains "&7Soulbound I":
    5.             remove loop-item from drops
    6.             set {_i} to loop-item
    7.             set {_s} to size of lore of {_i}
    8.             delete line {_s} of lore of {_i}
    9.             add {_i} to {_to.give::*}
    10.     wait 5 ticks
    11.     add {_to.give::*} to victim's inventory
    12.  
     
  13. Bell O'dell

    Bell O'dell Member

    Joined:
    Nov 19, 2022
    Messages:
    10
    Likes Received:
    0
    works
     
  14. ImOfflinezzz

    Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    76
    Likes Received:
    10
    You are welcome:3
     
  15. Bell O'dell

    Bell O'dell Member

    Joined:
    Nov 19, 2022
    Messages:
    10
    Likes Received:
    0
    Never mind. It's inconsistent and when it does work sometimes it removes the wrong lore.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...