#How would I make this more optimized so I dont have to type all the lore over again.

1 messages · Page 1 of 1 (latest)

tough fog
#

I need it so the skript doesnt have 200 letters per line. and just add lore,
Heres a code snipit!

    if name of player's current inventory contains "&aPickaxe Upgrades":
        cancel event
        if index of event-slot is 12:            
            set {_tool} to player's tool
            remove {_tool} from player's inventory
            add {_tool} with lore "&eToken" to player' inventory```
#

Explanation:

I want to make it so it will add lore "&eToken Finder %{tokenfinder::%player's uuid%}%"

#

and i dont wanna have to retype all the lore over again

wet hinge
#

Loop the lore, add 1 to a tempvar, set line tempvar+1

tough fog
#

Example please?

#

Would I do like

loop lore of {_tool}:

#

?

#

Okay so i know that u can do that

#

But what would i do after that

#

Like how would I make the tempvar = lore and not 1,2,3,4,5,6

#

Like

#

I do

    add 1 to {tempvar}```
#

o wait

#

I shouldnt loop 6 times i just put it into the loop lore thing

#

but it still comes out like 1,2,3

#

cause i have 3 lines of lore

#

KT_PurpleUpArrow Bump

hidden sedge
#

Set {_lore::*} to split "lore1|lore2lore3" at "|"

tough fog
#

Thats my lore

#

would it work?

hidden sedge
#

Then loop that list and set line of lore x+loop-number to {_lore::%loop-number%}

tough fog
#

Would it still work with the lore i have?

hidden sedge
#

It should

#

I have mine as a 5 line function or smth

#

How did u create the item in image?

tough fog
#

Thats what it shows

tough fog
hidden sedge
#

Nvm

#

I just put all my different lines of lore into one string

#

And then split it into a list and loop through to set different lines

#

Not sure if its the best approaxh but works for me

tough fog
#

Using ur way i changed it up and just did

            set {_lore::*} to "%loop-value%"
#
    if name of player's current inventory contains "&aPickaxe Upgrades":
        cancel event
        if index of event-slot is 12:            
            set {_tool} to player's tool
            loop lore of {_tool}:
                set {_lore::*} to "%loop-value%"
                send "%{_lore::*}%"
            remove {_tool} from player's inventory
            add {_tool} with lore "&bEnchants:" and "%{_lore::*}%" and "&c&l | &eToken Finder %{tokenfinder::%player's uuid%}%" to player' inventory``` 

Like this
#

Without the send in the loop

#

So thanks for the help!

#

:)

hidden sedge
#

interesting glad it seems to work

#

this is what im mainly using lists for

tough fog
#

Hmm Theress a bug in mine

hidden sedge
#

im guessing ur trying to update old items and add new enchants right?

tough fog
#

Yes

#

Sorta

#

But not an actual minecraft enchant

#

custom

hidden sedge
#

smth like this?

tough fog
#

Yes

hidden sedge
#

what does ur pickaxe look like before click?

tough fog
#

ima be redoing it

#

its just for testing

hidden sedge
#

So you just want to add token finder below right?

tough fog
#

Yes

#

i just need to add lore

#

after they click a inventory slot

hidden sedge
#

You can use

#

Set line x of lore of {_item} to "lore"

tough fog
#

hm

#

let me try

hidden sedge
#

Havent tested myself but have u tried like add "lore" to lore of item

tough fog
#

I wouldnt thing that would work

#

Well this worked: Set line x of lore of {_item} to "lore"

but had to remove the var

#

all good tho

#

@hidden sedge Do you know how to update the gui when they click the event-lot

#

slot*

hidden sedge
#

Whole gui or just one slot?

#

For whole gui just run the inventory opening function again

#

For slot set the slot item to something new

tough fog
#

1 sslot or whole gui

#

ok

#

Ill just rerun the open

#

Is there a way to close the inventory

hidden sedge
#

Probs smth like close inventory of player

#

Ive done it b4 but forgot lol

tough fog
#

I tried close current inventory of player

tough fog
hidden sedge
#

Try close player's inventory

tough fog
#

Any ideass on how to make thi look better

#

?

hidden sedge
#

Add symbols and stuff idk lol

tough fog
#

Any symbol ideass?

hidden sedge
#

You can replace cash with the coins emoji/symbol

#

Thats what im using for mine

#

Change "you earned" to green and money part to yellow

#

You can also play around with hexcolours like what i did in my list

tough fog
#

Any coin symbol suggession?