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 Not creating new line on lore

Discussion in 'Skript' started by AROD2003, Apr 23, 2020.

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

    AROD2003 Member

    Joined:
    Feb 14, 2017
    Messages:
    29
    Likes Received:
    1
    hi, so i was just messing around with skript and making custom enchantments however, i ran into an issue.

    Code (Text):
    1. set lore of event-slot to "%lore of event-slot%", "&7Repair"
    Code (Text):
    1. set lore of event-slot to "%lore of event-slot%" and "&7Repair"
    both lines above should accomplish the same thing, however, they only add 1 new lin, then put everything on the same line afterwords. here's a picture:

    https://imgur.com/a/oLVRGOG
    [​IMG]

    really my question is why isn't it adding a new line everytime, and how do i fix it?

     
  2. Best Answer:
    Post #15 by AROD2003, Apr 25, 2020
  3. IDuckz_

    IDuckz_ Active Member

    Joined:
    Jul 25, 2019
    Messages:
    106
    Likes Received:
    2
    Because you are setting the lore
     
  4. AROD2003

    AROD2003 Member

    Joined:
    Feb 14, 2017
    Messages:
    29
    Likes Received:
    1
    okay so what do i change it to
     
  5. IDuckz_

    IDuckz_ Active Member

    Joined:
    Jul 25, 2019
    Messages:
    106
    Likes Received:
    2
    You can try something like this:

    set line <line number> of the lore of player's tool to "hi"

    Edit: I believe you can check the line number too
     
  6. AROD2003

    AROD2003 Member

    Joined:
    Feb 14, 2017
    Messages:
    29
    Likes Received:
    1
    do you know how to check the line number?
    like, what i'm trying to do is add "Autosmelt" to the player's tool. do you know how i'd go about that?
     
  7. IDuckz_

    IDuckz_ Active Member

    Joined:
    Jul 25, 2019
    Messages:
    106
    Likes Received:
    2
    Code (Text):
    1. if line 1 of player's held item is "&aHi":
    2.     #do stuff
     
  8. AROD2003

    AROD2003 Member

    Joined:
    Feb 14, 2017
    Messages:
    29
    Likes Received:
    1
    do you know how to add "Autosmelt" to the item's lore?
     
  9. IDuckz_

    IDuckz_ Active Member

    Joined:
    Jul 25, 2019
    Messages:
    106
    Likes Received:
    2
    set line <line number> of lore of player's tool to "Autosmelt"
     
  10. AROD2003

    AROD2003 Member

    Joined:
    Feb 14, 2017
    Messages:
    29
    Likes Received:
    1
    okay but im saying i dont know what line to add to. i'm doing drag and drop enchants so i need to add to the lore and idk how to add to it and i dont know how many enchants theyre going to have. i need it to be dynamic
     
  11. blackid512

    blackid512 Member

    Joined:
    May 8, 2017
    Messages:
    23
    Likes Received:
    0
    Code (Skript):
    1.  
    2. command /relore [<text>] [<number>] [<text>]:
    3.     trigger:
    4.         if sender is console:
    5.             send "&cYou must be player to do this!"
    6.             stop
    7.         if sender doesn't have permission "item.relore":
    8.             send "&cYou must be moderator or higher to use this command!"
    9.             stop
    10.         if arg-1 is not set:
    11.             send "&cUsage: /relore (set/remove) (line) (text)"
    12.             stop
    13.         if player's tool is air:
    14.             send "&cThere is no item in your hand!"
    15.             stop
    16.         if arg-1 is "set":
    17.             if number-arg is not set:
    18.                 send "&cUsage: /relore set (line) (text)"
    19.                 stop
    20.             if arg-3 is not set:
    21.                 send "&cUsage: /relore set %number-arg% (text)"
    22.                 stop
    23.             if arg-3 contains "&":
    24.                 if sender doesn't have permission "item.relore.color":
    25.                     send "&cItem you relore contains color, you don't have the access!"
    26.                     send "&cYou must be admin or higher to use this feature!"
    27.                     stop
    28.                 set line number-arg of lore of player's tool to "%colored arg-3%"
    29.                 send "&aYour item lore has been changed!"
    30.                 stop
    31.             set line number-arg of lore of player's tool to "%arg-3%"
    32.             send "&aYour item lore has been changed!"
    33.             stop
    34.         if arg-1 is "remove":
    35.             if number-arg is not set:
    36.                 send "&cUsage: /relore remove (line/999)"
    37.                 stop
    38.             if number-arg is 999:
    39.                 if arg-3 is not set:
    40.                     send "&cWarning! You will remove your item lore!"
    41.                     send "&cUse &b/relore %arg-1% %number-arg% yes &cto clear your item lore."
    42.                     send "&cUse &b/relore %arg-1% %number-arg% no &cto cancel clearing your item lore."
    43.                     stop
    44.                 if arg-3 is "yes":
    45.                     set lore of player's tool to ""
    46.                     send "&aYour item lore has been removed!"
    47.                     stop
    48.                 if arg-3 is "no":
    49.                     send "&beYou cancel to remove the item lore."
    50.                     stop
    51.                 else:
    52.                     send "&cWarning! You will remove your item lore!"
    53.                     send "&cUse &b/relore %arg-1% %number-arg% yes &cto clear your item lore."
    54.                     send "&cUse &b/relore %arg-1% %number-arg% no &cto cancel clearing your item lore."
    55.                     stop
    56.             set line number-arg of lore of player's tool to ""
    57.             send "&aYour item lore has been changed!"
    58.             stop
    59.         send "&cUsage: /relore (set/remove) (line) (text)"
    60.         stop
    61.  
    Feel free to use my skript.
     
  12. AROD2003

    AROD2003 Member

    Joined:
    Feb 14, 2017
    Messages:
    29
    Likes Received:
    1
    i appreciate that but it doesnt really help
     
  13. MPGxxYT

    MPGxxYT Member

    Joined:
    Feb 14, 2018
    Messages:
    10
    Likes Received:
    0
    I assume you want it to be like,

    Autosmelt
    Jackhammer
    blah
    blah

    If that's the case, you could try to create a list and use that as a base. And tuske does support custom enchants which does that for you.
    Code (Text):
    1. loop {enchants::*}:
    2.     set line loop-number of lore of player's tool to "%loop-value%"
     
  14. AROD2003

    AROD2003 Member

    Joined:
    Feb 14, 2017
    Messages:
    29
    Likes Received:
    1
    yeah but i dont think tuske works on 1.15.2 but i could try that
     
  15. MPGxxYT

    MPGxxYT Member

    Joined:
    Feb 14, 2018
    Messages:
    10
    Likes Received:
    0
  16. AROD2003

    AROD2003 Member

    Joined:
    Feb 14, 2017
    Messages:
    29
    Likes Received:
    1
    alright, i'll try
    --- Double Post Merged, Apr 25, 2020, Original Post Date: Apr 25, 2020 ---
    Code (Text):
    1. set {_enchants::*} to lore of player's tool
    2. message "%{_enchants::*}%"
    3. add "testtest" to {_enchants::*}
    4. set lore of player's tool to {_enchants::*}
    alright, i fixed it by doing that :emoji_slight_smile:
     
  17. MPGxxYT

    MPGxxYT Member

    Joined:
    Feb 14, 2018
    Messages:
    10
    Likes Received:
    0
    Yup. No problem. <3
     
Thread Status:
Not open for further replies.

Share This Page

Loading...