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 Set lore of all of an item

Discussion in 'Skript' started by GlacialDew, May 3, 2019.

Thread Status:
Not open for further replies.
  1. GlacialDew

    GlacialDew Member

    Joined:
    Apr 8, 2018
    Messages:
    40
    Likes Received:
    3
    So I'm trying to figure out a way to set the lore of
    all iron swords that dont have lore.

    So if a player crafts one, finds one in a chest, gets one off a mob, or through a shop
    it will always have the set lore.

    I have no idea of how to do this and would like some help getting started.​


     
  2. Best Answer:
    Post #3 by Marsbar, May 9, 2019
  3. iChinchillinq

    iChinchillinq Member

    Joined:
    May 11, 2018
    Messages:
    10
    Likes Received:
    0
    Loop all of the items in a player's inventory and if it's an iron sword, set the lore
     
  4. Marsbar

    Marsbar Active Member

    Joined:
    Mar 31, 2019
    Messages:
    131
    Likes Received:
    4
    It has not tested this:
    Code (Text):
    1. variables:
    2.     {loressword::*} = "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "y", " " and "z"
    3.  
    4. options:
    5.     Text: This is the new lore! #The tool's lore
    6.  
    7. on inventory click:
    8.     wait 1 tick
    9.     loop all items in player's inventory:
    10.         if loop-item is a iron sword:
    11.             loop {loresword::*}:
    12.                 if lore of tool of player does contain "%loop-value%":
    13.                     stop
    14.                 set lore of tool of player to "{@Text}"
    --- Double Post Merged, May 9, 2019, Original Post Date: May 8, 2019 ---
    Han you add the same code to this event?
    [QUOTE="Marsbar,
    Code (Text):
    1. variables:
    2.     {loressword::*} = "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "y", " " and "z"
    3.  
    4. options:
    5.     Text: This is the new lore! #The tool's lore
    6.  
    7. on pickup:
    8.     wait 1 tick
    9.     loop all items in player's inventory:
    10.         if loop-item is a iron sword:
    11.             loop {loresword::*}:
    12.                 if lore of tool of player does contain "%loop-value%":
    13.                     stop
    14.                 set lore of tool of player to "{@Text}"
    [/QUOTE]

    On pickup:
    --- Double Post Merged, May 9, 2019 ---
    I Hate autocorrect from mobile
    But add the two events
     
Thread Status:
Not open for further replies.

Share This Page

Loading...