Jump to content

Lobby Compass


Big_Boi32

Recommended Posts

Hi,

I wanted to make a lobby compass, and got some help with it. Something isn't working, and when I check it with YAMLlint it says 

(<unknown>): found character that cannot start any token while scanning for the next token at line 2 column 1
This is the skript, if someone could please help me I would greatly appreciate it!

options:
    prefix: &3&lVouchers &8&l» &7

command /voucher [<string>] [<string>] [<string>]:
    permission: voucher.admin
    trigger:
        if arg 1 is set:
            if arg 1 = "create":
                if arg 2 is set:
                    if {vouchers::list::*} contains arg-2:
                        message "{@prefix} This does already exist!"
                        stop

                    add arg-2 to {vouchers::list::*}
                    message "{@prefix} Created the voucher &b%arg-2%"
                    stop

                else:
                    message "{@prefix} Specify a name for the voucher!"
                    stop
            
            if arg 1 = "delete":
                if arg 2 is set:
                    if {vouchers::list::*} doesn't contain arg-2:
                        message "{@prefix} This voucher does not exist!"
                        stop
                    
                    remove arg-2 from {vouchers::list::*}
                    message "{@prefix} Deleted voucher &b%arg-2%"

                    delete {voucher::%arg-2%::*}
                    stop
                
                else:
                    message "{@prefix} Specify the name of the voucher you want to delete!"
                    stop

            if arg 1 = "setcommand":
                if arg 2 is set:
                    if arg 3 is set:
                        if {vouchers::list::*} doesn't contain arg-2:
                            message "{@prefix} This voucher does not exist!"
                            stop

                        set {voucher::%arg-2%::command} to arg-3
                        message "{@prefix} Set the command of voucher &b%arg-2% &7to &b%arg-3%"
                        stop
                    else:
                        message "{@prefix} Please specify a command!"
                        stop
                else:
                    message "{@prefix} Please specify the name of the voucher."
                    stop
            
            if arg 1 = "setmessage":
                if arg 2 is set:
                    if arg 3 is set:
                        if {vouchers::list::*} doesn't contain arg-2:
                            message "{@prefix} This voucher does not exist!"
                            stop

                        set {voucher::%arg-2%::message} to arg-3
                        message "{@prefix} Set the message of voucher &b%arg-2% &7to &b%arg-3%"
                        stop
                    else:
                        message "{@prefix} Please specify a message!"
                        stop
                else:
                    message "{@prefix} Please specify the name of the voucher."
                    stop
            
            if arg 1 = "give":
                if arg 2 is set:
                    if {vouchers::list::*} doesn't contain arg-2:
                        message "{@prefix} This voucher does not exist!"
                        stop
                    
                    give 1 of paper named "&7%arg-2%" with lore "&7Click to claim" to the player
                    message "{@prefix} Gave you the voucher!"
                    stop
                else:
                    message "{@prefix} Please specify the name of the voucher."
                    stop
        else:
            message "{@prefix} Usage: /voucher ( create / delete / give / setcommand / setmessage ) ( arguments ) "


on rightclick:
    if type of player's tool = compass:
        set {&6Main Menu} to name of player's tool
        replace all "&7" with "" in {&6Main Menu}
        if {vouchers::list::*} contains "%{&6Main Menu}%":
            if lore of player's tool = "&7Click to Open":
                set {_name} to {&6Main Menu}
                remove 1 of player's tool from player's inventory
                # Changing {player} with %player%
                set {_replace} to ReplacePlaceholder({voucher::%{_name}%::command}, "{player}", "%player%")
                execute console command "%{_replace}%"
                message "{@prefix} %{voucher::%{_name}%::message}%"

on load:
    if {vouchers::list::*} is not set:
        add "" to {vouchers::list::*}

Link to comment
Share on other sites

When you say something isn't working, what exactly isn't working of the skript?

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

I honestly don't know. I am not in any way good at skript, and I don't even know anything about that. I got sent that in a skript help discord server, and I changed it so that it would work for me. I thought I was just meant to put that in a script folder, and restart skript, then right click a compass. I am clearly wrong.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...