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.

UTF-8 in yaml

Discussion in 'Skript' started by sluhtie, Mar 17, 2020.

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

    Supporter

    Joined:
    Feb 8, 2020
    Messages:
    30
    Likes Received:
    2
    Hello everyone, I want to crate a external config using Skript where you can set the prefix of my Skript. But everytime I open the generated config there are these funny color codes:

    Code (Text):
    1. prefix: "\xa78[\xa7eAntiBuild\xa78]"
    But I want to have the Color codes like &a and &4... If you know what I mean.

    Well the value works good but If I Change the prefix in the extrenal config from "\xa78[\xa7eAntiBuild\xa78]" to "&8 ● &eMagma&6Vace &8»" I become this message in chat:

    [​IMG]

    Firstly the Color codes don't work and the UTF-8 dosen't work so how can I Import Color codes and UTF-8 format in external configs?

    Here is my Skript:

    Code (Skript):
    1. on load:
    2.     file existance of "plugins/AntiBuild/config.yml" is false:
    3.         create file "plugins/AntiBuild/config.yml"
    4.         set "prefix" to "&8[&dPrefix&8]" in yaml file "plugins/AntiBuild/config.yml"
    5.  
    6.  
    7. command /test:
    8.     trigger:
    9.         set {prefix} to single value "prefix" get of "plugins/AntiBuild/config.yml"
    10.         broadcast "%{prefix}%"

    Here is the generated config.yml:

    Code (Text):
    1. prefix: "\xa78[\xa7eAntiBuild\xa78]"
    2.  

    Skript Addons:
    WildSkript (Ver: 1.8)
    Skellett (Ver: 1.9.6b)
    skRayFall (Ver: 1.9.19)
    SkQuery (3.21.4)

    Skript Version: 2.1.2
    Server Version: Spigot 1.8.8
    Client Version: Vanilla 1.8.9

    Thanks for every answer!
     
    #1 sluhtie, Mar 17, 2020
    Last edited: Mar 17, 2020
  2. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    314
    Likes Received:
    21
    Have you tried § instead of &?
     
  3. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    664
    Likes Received:
    45

    Make shure the charset of both the .yml and the .sk are set.

    [​IMG]

    [​IMG]
     
  4. blackid512

    blackid512 Member

    Joined:
    May 8, 2017
    Messages:
    23
    Likes Received:
    0
    You must do like this

    Code (Skript):
    1.  
    2. on load:
    3.     file existance of "plugins/AntiBuild/config.yml" is false:
    4.         create file "plugins/AntiBuild/config.yml"
    5.         set {_pf} to "
    6.        set {_pf} to "&8[&dPrefix&8]"
    7.        set yaml value "prefix" to "%uncolored {_pf}%" in yaml file "plugins/AntiBuild/config.yml"
    8.  
    9.  
    10. command /test:
    11.    trigger:
    12.        set {prefix} to single value "prefix" get of "plugins/AntiBuild/config.yml"
    13.        broadcast "%colored {prefix}%"
    14.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...