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 change the lore of the last item obtained?

Discussion in 'Skript' started by nicolas toledo, Jun 24, 2021.

Thread Status:
Not open for further replies.
  1. nicolas toledo

    Joined:
    Mar 29, 2020
    Messages:
    28
    Likes Received:
    0
    Hello, I am looking for some way to change the lore of a newly obtained item. What I want is immediately after lifting the item to change a line of lore Try something like this but it doesn't work.

    Code (Text):
    1. on pickup:
    2.   set {_l2::*} to lore of item
    3.   loop {_l2::*}:
    4.     if loop-value contains "&fCrit chance: &9?":
    5.       replace every "&fCrit chance: &9?" in lore of item with "&fCrit chance: &93"
    6.       stop    

    SOLUTION:

    Code (Text):
    1. on pickup:
    2.     wait 1 tick
    3.     loop all items in player's inventory:
    4.         set {_l2::*} to lore of loop-item
    5.         loop {_l2::*}:
    6.             if loop-value-2 contains "new":
    7.                 replace every "new" in lore of loop-item with "test"
     
    #1 nicolas toledo, Jun 24, 2021
    Last edited: Jun 24, 2021
  2. Juggernaut

    Juggernaut New Member

    Joined:
    Jun 21, 2021
    Messages:
    5
    Likes Received:
    1
    Take a loot at this, it works for me:

    Code (Text):
    1. on pickup:
    2.     if lore of item contains "&fCrit chance: &9?":
    3.         set the 1st line of the item's lore to "&fCrit chance: &93"
     
  3. nicolas toledo

    Joined:
    Mar 29, 2020
    Messages:
    28
    Likes Received:
    0
    It doesn't work for me, from what I see when I ask to change the lore of the "item's" it doesn't work, but if I change it to player's tool it works: /. I can't understand why one works and the other doesn't
    --- Double Post Merged, Jun 24, 2021, Original Post Date: Jun 24, 2021 ---
    solution:

    Code (Text):
    1. on pickup:
    2.     wait 1 tick
    3.     loop all items in player's inventory:
    4.         set {_l2::*} to lore of loop-item
    5.         loop {_l2::*}:
    6.             if loop-value-2 contains "new":
    7.                 replace every "new" in lore of loop-item with "test"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...