Solved HELP - Lists not working!

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

Jay_2004

Member
Feb 21, 2017
13
1
3
25
Hi!
Look at this:
Code:
command /sounds [<text>] [<text>]:
    trigger:
        if arg 1 is not set:
            send "&d&m---------------------[ &9Sounds &d&m]---------------------"
            send "&a&o/sounds &7- &6&oShow this help page."
            send "&a&o/sounds list &7- &6&oList every sound in the database."
            send "&a&o/sounds search (sound)"
            send "&aFor an example: '&6/sounds search zombie&a' this will search for all the sounds that a zombie makes."
        if arg 1 is "search":
            if arg 2 is set:
                loop {sound.database::*}:
                    if loop-value contains "%arg-2%":
                        add "%loop-value%" to {output::*}
                send "{@P} &aSearch found results for &6%arg-2%&a;"
                loop {output::*}:
                    send "&6%loop-value%"

This part:
Code:
        if arg 1 is "search":
            if arg 2 is set:
                loop {sound.database::*}:
                    if loop-value contains "%arg-2%":
                        add "%loop-value%" to {output::*}
                send "{@P} &aSearch found results for &6%arg-2%&a;"
                loop {output::*}:
                    send "&6%loop-value%"
Doesn't work...
What I am trying to do is to make a script with all Minecraft sounds and you can search for them, but it doesn't work. This part:
Code:
                loop {sound.database::*}:
                    if loop-value contains "%arg-2%":
                        add "%loop-value%" to {output::*}
to me I think is not working. It won't put the 'loop-value' that matches 'arg-2' (search query). For an example I type in '/sounds search zombie' it should bring up all the sounds that CONTAIN 'zombie' so 'mob.zombie.remedy' should show up in the {output::*} but it doesn't.
[doublepost=1491707791,1491622373][/doublepost]bump
[doublepost=1491708417][/doublepost]Download:
https://www.mediafire.com/?3jn15txq1iqg856
(Mega isn't working sorry if it's against the rules to use Mediafire but there's no direct upload button.)
 
the expresión "contains" is a bit buggy, try 'if loop-value is %arg-2%'
Works, but doesn't do what I want it to do. If I type in /sounds search zombie it comes up with nothing. But if I type /sounds search mob.zombie.remedy it works which is not what I want.
(Nice grammar I have there...)
 
Works, but doesn't do what I want it to do. If I type in /sounds search zombie it comes up with nothing. But if I type /sounds search mob.zombie.remedy it works which is not what I want.
(Nice grammar I have there...)
Try this (Not tested)
code_language.skript:
loop {sound.database::*}:
    set {_text} to loop-value parsed as text
    if {_text} contains "%arg-2%":
        add "%loop-value%" to {output::*}
 
Status
Not open for further replies.