Solved Not creating new line on lore

  • 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.

AROD2003

Member
Feb 14, 2017
29
1
0
hi, so i was just messing around with skript and making custom enchantments however, i ran into an issue.

Code:
set lore of event-slot to "%lore of event-slot%", "&7Repair"
Code:
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
oLVRGOG


really my question is why isn't it adding a new line everytime, and how do i fix it?
 
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
 
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?
 
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
 
code_language.skript:
command /relore [<text>] [<number>] [<text>]:
    trigger:
        if sender is console:
            send "&cYou must be player to do this!"
            stop
        if sender doesn't have permission "item.relore":
            send "&cYou must be moderator or higher to use this command!"
            stop
        if arg-1 is not set:
            send "&cUsage: /relore (set/remove) (line) (text)"
            stop
        if player's tool is air:
            send "&cThere is no item in your hand!"
            stop
        if arg-1 is "set":
            if number-arg is not set:
                send "&cUsage: /relore set (line) (text)"
                stop
            if arg-3 is not set:
                send "&cUsage: /relore set %number-arg% (text)"
                stop
            if arg-3 contains "&":
                if sender doesn't have permission "item.relore.color":
                    send "&cItem you relore contains color, you don't have the access!"
                    send "&cYou must be admin or higher to use this feature!"
                    stop
                set line number-arg of lore of player's tool to "%colored arg-3%"
                send "&aYour item lore has been changed!"
                stop
            set line number-arg of lore of player's tool to "%arg-3%"
            send "&aYour item lore has been changed!"
            stop
        if arg-1 is "remove":
            if number-arg is not set:
                send "&cUsage: /relore remove (line/999)"
                stop
            if number-arg is 999:
                if arg-3 is not set:
                    send "&cWarning! You will remove your item lore!"
                    send "&cUse &b/relore %arg-1% %number-arg% yes &cto clear your item lore."
                    send "&cUse &b/relore %arg-1% %number-arg% no &cto cancel clearing your item lore."
                    stop
                if arg-3 is "yes":
                    set lore of player's tool to ""
                    send "&aYour item lore has been removed!"
                    stop
                if arg-3 is "no":
                    send "&beYou cancel to remove the item lore."
                    stop
                else:
                    send "&cWarning! You will remove your item lore!"
                    send "&cUse &b/relore %arg-1% %number-arg% yes &cto clear your item lore."
                    send "&cUse &b/relore %arg-1% %number-arg% no &cto cancel clearing your item lore."
                    stop
            set line number-arg of lore of player's tool to ""
            send "&aYour item lore has been changed!"
            stop
        send "&cUsage: /relore (set/remove) (line) (text)"
        stop
Feel free to use my skript.
 
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:
loop {enchants::*}:
    set line loop-number of lore of player's tool to "%loop-value%"
 
alright, i'll try
[doublepost=1587771448,1587770879][/doublepost]
Code:
set {_enchants::*} to lore of player's tool
message "%{_enchants::*}%"
add "testtest" to {_enchants::*}
set lore of player's tool to {_enchants::*}

alright, i fixed it by doing that :emoji_slight_smile:
 
Status
Not open for further replies.