Solved lore of specific slot

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

Efnilite

Supporter
May 12, 2018
218
15
18
your basement
no.com
Hey there,

so, i want to get the integer from line 2 of the lore of a specific slot (slot 11 in this case), how would you do this? I tried a lot, like using skript-mirror
code_language.skript:
set {_e} to player.getInventory().getItem(11)
but this returned a space.

I tried
code_language.skript:
set {_b::*} to lore of slot 11 of player split at ":"
set {_b} to 1st element of {_b::*}

and

set {_epath::*} to uncolored line 2 of lore of slot 11 of player's inventory
set {_path::1} to first element of {_epath::1} split at " "
and with current inventory iso inventory.
but they returned spaces also

I want to get the integer from
code_language.skript:
Price: 600 coins
this line (line 2 of lore)

anyone know how to do this?
[doublepost=1534254071,1534241632][/doublepost]oof bumperino
 
you may be having compability issues or something.
I've somewhat used your code and it works:
code_language.skript:
on inventory click:
    broadcast "%event-slot%"
   
command /test:
    trigger:
       
        set {_line} to uncolored line 2 of slot 11 of command sender's inventory's lore
        set {_split::*} to {_line} split at " "
        loop {_split::*}:
            send "%loop-value%"

or this:
code_language.skript:
on inventory click:
    broadcast "%event-slot%"
    
command /test2:
    trigger:
        set {_i} to diamond sword named "fuck"
        set line 1 of {_i}'s lore to "fuckballs"
        set line 2 of {_i}'s lore to "test: 222 coins"
        add 1 of {_i} to command sender's inventory
    
command /test:
    trigger:
        
        set {_line} to uncolored line 2 of slot 11 of command sender's inventory's lore
        set {_split::*} to {_line} split at " "
        loop {_split::*}:
            loop-value parsed as number is set
            broadcast "    &anumber:&r %loop-value%"
            exit loop
 
Last edited:
bump? .-.
[doublepost=1534281872,1534281841][/doublepost]
you may be having compability issues or something.
I've somewhat used your code and it works:
code_language.skript:
on inventory click:
    broadcast "%event-slot%"
  
command /test:
    trigger:
      
        set {_line} to uncolored line 2 of slot 11 of command sender's inventory's lore
        set {_split::*} to {_line} split at " "
        loop {_split::*}:
            send "%loop-value%"

or this:
code_language.skript:
on inventory click:
    broadcast "%event-slot%"
   
command /test2:
    trigger:
        set {_i} to diamond sword named "fuck"
        set line 1 of {_i}'s lore to "fuckballs"
        set line 2 of {_i}'s lore to "test: 222 coins"
        add 1 of {_i} to command sender's inventory
   
command /test:
    trigger:
       
        set {_line} to uncolored line 2 of slot 11 of command sender's inventory's lore
        set {_split::*} to {_line} split at " "
        loop {_split::*}:
            loop-value parsed as number is set
            broadcast "    &anumber:&r %loop-value%"
            exit loop
It returned none..
 
Don't get this wrong; but have you made certain that there is an item in slot 11 that does have at least 2 lines of lore?
 
Status
Not open for further replies.