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 our 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 bugged lore of items (TuSKe - GUI)

Discussion in 'Skript' started by HardMCore, Jul 13, 2019.

  1. H

    HardMCore Member

    Joined:
    Jul 13, 2019
    Messages:
    2
    Likes Received:
    0
    Server is 1.13.2 (Paper version git-Paper-637 (MC: 1.13.2) (Implementing API version 1.13.2-R0.1-SNAPSHOT), I use 2.3.7 version of skript and TuSKe 1.8.3 pikachu-patch v3.
    The problem is that "format gui slot" is changing/saving or idk what the lore. And the second problem: ||, %nl%, %newline% and \n doesn't work. I also tried with lore "1", "2" and "3" and it also didnt work.

    Code (Text):
    1.  
    2.                 loop {itemytargu.%arg-1%::*}:
    3.                     format gui slot loop-index parsed as integer -1 of player with loop-value with lore "%lore of loop-value% \n test" to close
    4.  
    And what happens is that lore of the item changes every time the loop triggers. The loop is looking like that: "*actual lore of item* \n test \n test \n test \n test " and every time it loops again (every time I use command with this loop) it adds another "\n test " to the lore. Is there possibility of repairing it? Since to the lore of the item I just want to add other variable and make it be in the next line of lore, so it would look like
    *lore of the item*
    My lore: %variable%

    Also, when I changed this line to:
    Code (Text):
    1. format gui slot loop-index parsed as integer -1 of player with loop-value to close
    (simply removed lore)
    it still appears the whole lore to be "*actual lore of item*\ n test \n test..."
    BUT it actually doesnt change the lore of the item (when I check the variable out of the loop in any other way, the lore of the item works correctly).

    So ye, this is a very complicated error (I mean, it doesnt show any errors, but it just doesnt work). Is there possiblity of repairing it, or is there a working GUI addon?
     
    #1 HardMCore, Jul 13, 2019
    Last edited: Jul 13, 2019
  2. T

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,202
    Likes Received:
    69
    Medals:
    For multiple lore lines: `%item% with lore "line 1", "line 2" and "line 3"`
    Maybe it'll work when you set a local variable to the loop-value, then check for the lore in that local variable. Still not what you want? Try setting the lore of that local variable to `""`, or deleting it.
     
  3. H

    HardMCore Member

    Joined:
    Jul 13, 2019
    Messages:
    2
    Likes Received:
    0
    @TPGamesNL Thanks for all the help here and on discord, I changed my code to:
    Code (Text):
    1.  
    2.                 loop {itemytargu.%arg-1%::*}:
    3.                     format gui slot loop-index parsed as integer -1 of player with loop-value to close
    4.                     wait 2 ticks
    5.                     set {loreitemu.%player%} to "%lore of loop-value%"
    6.                     set lore of slot loop-index parsed as integer -1 of player's current inventory to "%{loreitemu.%player%}%", " ", "&6Price: &c%{itemprice.%player%::%loop-index%}%"
    7.  
    now the lore lines and variables work just like I wanted. Unluckily, there is one bug left in TuSKe, which is that e.g. 'close then run "command"' doesn't work at all after using /sk reload, to make it work, skript requires server restart, but I dont need any help with that.
     
Loading...