Solved How to change the lore of the last item obtained?

  • 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.
Mar 29, 2020
28
0
1
29
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:
on pickup: 
  set {_l2::*} to lore of item
  loop {_l2::*}:
    if loop-value contains "&fCrit chance: &9?": 
      replace every "&fCrit chance: &9?" in lore of item with "&fCrit chance: &93"
      stop


SOLUTION:

Code:
on pickup:
    wait 1 tick
    loop all items in player's inventory:
        set {_l2::*} to lore of loop-item
        loop {_l2::*}:
            if loop-value-2 contains "new":
                replace every "new" in lore of loop-item with "test"
 
Last edited:
Take a loot at this, it works for me:

Code:
on pickup:
    if lore of item contains "&fCrit chance: &9?":
        set the 1st line of the item's lore to "&fCrit chance: &93"
 
Take a loot at this, it works for me:

Code:
on pickup:
    if lore of item contains "&fCrit chance: &9?":
        set the 1st line of the item's lore to "&fCrit chance: &93"
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
[doublepost=1624544879,1624540219][/doublepost]
Take a loot at this, it works for me:

Code:
on pickup:
    if lore of item contains "&fCrit chance: &9?":
        set the 1st line of the item's lore to "&fCrit chance: &93"
solution:

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