Solved YML Variables

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

glowgrew

Active Member
Jan 26, 2017
99
7
0
Perm, Russia
Hello. How can I check a length of arg via YML variable?

Problem part of code:
Code:
length of arg 1 <=  "%{config::main::maxhomes}%":
This code isn't sending any issues, but it doesn't work.

Full command:
Code:
command /sethome [<text=1>]:
    trigger:
        ColourfulAPI("z")
        arg-1 is set:
            length of arg 1 <= {@maxhomelength}:
                arg-1 doesn't contain {@notallowed}:
                    {homes::%player%::%arg-1%} isn't set:
                        {homes.amount::%player%} <= {@maxhomes} - 1:
                            set {homes::%player%::%arg 1%} to location of player
                            add 1 to {homes.amount::%player%}
                            send colored "{@p} Дом {@v}%arg-1%&f установлен в текущем месте."
                            stop
                        else:
                            send colored "{@p} У вас максимльное кол-во домов! Удалите несколько и повторите попытку."
                    else:
                        send colored "{@p} У вас уже есть дом с таким-же названием."
                else:
                    send colored "{@p} Название не должно содержать введённых символов."
            else:
                send colored "{@p} Название должно быть меньше {@v}%{config::main::maxhomelength}%&f символов."
 
Oh. I have to check the argument's length using {config::main::maxhomelength} as integer times.
Code:
set yml value "main.maxhomelength" of file "plugins/MerHomes/config.yml" to "8"
set {config::main::maxhomelength} to yml value "main.maxhomelength" of file "plugins/MerHomes/config.yml"
 
Status
Not open for further replies.