Solved How to add more than 1 permission ?

  • 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 community!

    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.

Adrihun

Member
Feb 1, 2017
368
6
0
My Script won't work?
This is a money script. And i made it so if i change the player's money, it updates their scoreboard too!

But!
Only works for my admins, not owners (line 26-37). What am i doing wrong? :emoji_frowning:

code_language.skript:
command /setdollar [<offline player>] [<text>]:
    permission: setmoneyy
    permission message: cant do that
    trigger:
        if arg-2 parsed as integer isn't set:
            send "wrong usage"
            stop
        arg 1 is set:
            arg 2 is set:
                set {_num} to arg-2 parsed as an integer
                if arg 1 is online:
                    if arg 1 is player:
                        send "not a number"
                        stop
                    difference between {sql_.diff.setmoney::%player%} and now is less than 30 seconds:
                        send "cooldown"
                        stop
                    if {_num} is greater than 500000:
                        send "too much"
                        stop
                    set {sql_.diff.setmoney::%player%} to now
                    {@run_async} is "true":
                        $ thread
                    set {_message} to adddollar(arg 1, {_num}, 1)
                    send "you set %arg-1%&9's dollar to &5%{_num}%."
                    arg-1 has permission "tag.admin"
                    wait 1 tick
                    createBoard(arg-1, "Admin", 15)
                    set title of stylish scoreboard "Admin-%arg-1%" to "&a test"
                    set stylish scoreboard of arg-1 to "Admin-%arg-1%"
                    updateBoard7(arg-1)
                    arg-1 has permission "tag.owner"
                    wait 1 tick
                    createBoard(arg-1, "Owner", 15)
                    set title of stylish scoreboard "Owner-%arg-1%" to "&a test2"
                    set stylish scoreboard of arg-1 to "Owner-%arg-1%"
                    updateBoard8(arg-1)
 
                else:
                    send "offline"
            else:
                send "wrong usage"
        else:
            send "wrong usage"
 
Try this:
code_language.skript:
command /setdollar [<offline player>] [<text>]:
    permission: setmoneyy
    permission message: cant do that
    trigger:
        if arg-2 parsed as integer isn't set:
            send "wrong usage"
            stop
        arg 1 is set:
            arg 2 is set:
                set {_num} to arg-2 parsed as an integer
                if arg 1 is online:
                    if arg 1 is player:
                        send "not a number"
                        stop
                    difference between {sql_.diff.setmoney::%player%} and now is less than 30 seconds:
                        send "cooldown"
                        stop
                    if {_num} is greater than 500000:
                        send "too much"
                        stop
                    set {sql_.diff.setmoney::%player%} to now
                    {@run_async} is "true":
                        $ thread
                    set {_message} to adddollar(arg 1, {_num}, 1)
                    send "you set %arg-1%&9's dollar to &5%{_num}%."
                    if arg-1 has permission "tag.admin":
                        wait 1 tick
                        createBoard(arg-1, "Admin", 15)
                        set title of stylish scoreboard "Admin-%arg-1%" to "&a test"
                        set stylish scoreboard of arg-1 to "Admin-%arg-1%"
                        updateBoard7(arg-1)
                    else if arg-1 has permission "tag.owner":
                        wait 1 tick
                        createBoard(arg-1, "Owner", 15)
                        set title of stylish scoreboard "Owner-%arg-1%" to "&a test2"
                        set stylish scoreboard of arg-1 to "Owner-%arg-1%"
                        updateBoard8(arg-1)
 
                else:
                    send "offline"
            else:
                send "wrong usage"
        else:
            send "wrong usage"
 
Status
Not open for further replies.