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.

Solved How to remove specific lore of a item?

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

  1. Bell O'dell

    Bell O'dell New Member

    Joined:
    Nov 19, 2022
    Messages:
    7
    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. Best Answer:
    Post #12 by ImOfflinezzz, Nov 27, 2022 at 12:06 PM
  3. MultiverShaun

    MultiverShaun Member

    Joined:
    Aug 8, 2022
    Messages:
    17
    Likes Received:
    0
    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
     
  4. Bell O'dell

    Bell O'dell New Member

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

    MultiverShaun Member

    Joined:
    Aug 8, 2022
    Messages:
    17
    Likes Received:
    0
    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
     
  6. Bell O'dell

    Bell O'dell New Member

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

    MultiverShaun Member

    Joined:
    Aug 8, 2022
    Messages:
    17
    Likes Received:
    0
    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
     
  8. Bell O'dell

    Bell O'dell New Member

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

    MultiverShaun Member

    Joined:
    Aug 8, 2022
    Messages:
    17
    Likes Received:
    0
    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
     
  10. Bell O'dell

    Bell O'dell New Member

    Joined:
    Nov 19, 2022
    Messages:
    7
    Likes Received:
    0
    no the dropped item doesnt have removed lore.
     
  11. 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
     
  12. Bell O'dell

    Bell O'dell New Member

    Joined:
    Nov 19, 2022
    Messages:
    7
    Likes Received:
    0
    Now there is no dropped item or item in my inventory.
     
  13. 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.  
     
  14. Bell O'dell

    Bell O'dell New Member

    Joined:
    Nov 19, 2022
    Messages:
    7
    Likes Received:
    0
    works
     
  15. ImOfflinezzz

    Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    76
    Likes Received:
    10
    You are welcome:3
     

Share This Page

Loading...