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 New Line question for json.sk

Discussion in 'Skript' started by Wynnevir, May 1, 2020.

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

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    1,016
    Likes Received:
    62
    I've been trying a few different versions of skript to get the %new line% expression in any of its variations to work in tooltip. It's on a 1.15.2 server, but regardless of version it cant understand the new line expression on reload.
    Does anyone know if there is a version that works,a workaround or if it just doesn't work at all for now?

     
  2. Best Answer:
    Post #5 by TPGamesNL, May 1, 2020
  3. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    It works normally, as long as you use Skripts tooltips: https://skriptlang.github.io/Skript/text.html (not using json.sk)
     
  4. Abdera7mane

    Abdera7mane Active Member

    Joined:
    Aug 18, 2019
    Messages:
    56
    Likes Received:
    7
    new line expression was introduced in Skript 2.5, for older versions either install SkQuery or use Skript-mirror.
     
  5. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    1,016
    Likes Received:
    62
    I do have SkQuery, and its up to date. though ive tried other versions too. as soon as I add the %newline% expression it reloads without errors, but stops sending
    I get either white space errors in console or incorrect argument errors.
    Specifically, argument errors for %nl% and white space errors for %newline% and %new line%

    Regular skript's tooltips don't support variables, which is the only reason why im not using them.
    Code (Text):
    1. 01.05 16:03:31 [Server] Server thread/INFO Cymmerii issued server command: /sk reload test
    2. 01.05 16:03:33 [Server] Server thread/INFO Expected whitespace to end one argument, but found trailing data
    3. 01.05 16:03:33 [Server] Server thread/INFO ...":[{"text":"Cymmerii §r","hoverEvent":{"action": "show_text","value": "Line1
    4. 01.05 16:03:33 [Server] INFO line2"}},{"text":"§r§7t"}]}<--[HERE]
    5. 01.05 16:04:29 [Server] Server thread/INFO Cymmerii issued server command: /sk reload test
    6. 01.05 16:05:15 [Server] Server thread/INFO Cymmerii issued server command: /sk reload test
    7. 01.05 16:05:16 [Server] Server thread/INFO Expected whitespace to end one argument, but found trailing data
    8. 01.05 16:05:16 [Server] Server thread/INFO ...:[{"text":"Cymmerii §r","hoverEvent":{"action": "show_text","value": "Line1
    9. 01.05 16:05:16 [Server] INFO line2"}},{"text":"§r§7tt"}]}<--[HERE]
    Edit: The code as well, it works so long as the "%newline% bit is gone:emoji_frowning:
    Code (Text):
    1. on chat:
    2.     clear chat recipients
    3.     loop all players:
    4.         json("%loop-value%","%player's display name% ||ttp:Line1%newline%Line2||&7%message%")
     
  6. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    Skript tooltips do support variables, you just have to use send formatted instead of just send.
     
  7. Wynnevir

    Wynnevir Well-Known Member

    Joined:
    Jul 9, 2017
    Messages:
    1,016
    Likes Received:
    62
    Ah! Thank you that's the piece I was missing.
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...