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 variable to lore of item

Discussion in 'Skript' started by Squarebuilder, Apr 22, 2021.

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

    Squarebuilder Member

    Joined:
    Aug 6, 2020
    Messages:
    10
    Likes Received:
    0
    Hello,

    for one of my scripts I have to set a variable on the lore of an item. Does anyone know how to do that?

    Code (Text):
    1. on right-click:
    2.     set {_variable} to lore of event-item
    Error Code: {_variable} can only be set to an object, not more.
    [​IMG]
    [​IMG]
     
    #1 Squarebuilder, Apr 22, 2021
    Last edited: Apr 23, 2021
  2. Shadow501pl

    Shadow501pl Active Member

    Joined:
    Dec 19, 2020
    Messages:
    62
    Likes Received:
    2
    Lore of item is a array so you would need to do:
    Code (Text):
    1. loop lore of player's held item:
    2.   if loop-value is "confusion 1":
    3.     set {_confusion} to 1
    4.   #etc
     
    • Like Like x 1
  3. Squarebuilder

    Squarebuilder Member

    Joined:
    Aug 6, 2020
    Messages:
    10
    Likes Received:
    0
  4. PatoFrango

    PatoFrango Active Member

    Joined:
    Jul 12, 2017
    Messages:
    240
    Likes Received:
    14
    Or just
    Code (Text):
    1. set {_lore::*} to lore of event-item
    Where each element is a line of the lore
     
Thread Status:
Not open for further replies.

Share This Page

Loading...