Crazy crates key shortcut command (skript)

Status
This thread has been locked.

Aoid

Feedback score
1
Posts
259
Reactions
58
Resources
0
Tired of writing '/cc give P god 1 (name)' to give players keys?
Well I made a shortcut command '/key'for crazy crates
it's currently supporting only god crate keys, voting and money keys
Command usage > /key (name) (key)
The permission is "crate.key"

Here's the code​
Code:
command /key [<offlineplayer>] [<text>]:
    permission: crate.key
    trigger:
        if player doesn't have permission "god.key":
            send "&cYou do not have permissions to execute this command!" to player
        else:
            if arg-1 is not set:
                send "&cInvalid command! &7Maybe try /key (player) (key)" to player
            else:
                if arg-2 is not set:
                    send "&cInvalid command! &7Maybe try /key (player) (key)" to player
                else:
                    if arg-1 is offline:
                        send "&cThe player you specified is currently offline!"
                    else:
                        if arg-2 is "voting":
                            make console execute command "/cc give P voting 1 %arg-1%"
                            send "&aYou have given %arg-1% 1 &9Voting key&7!" to player
                            send "&aYou have recieved 1 &9voting key&7!" to arg-1
                        else:
                            if arg-2 is "money":
                                make console execute command "/cc give P money 1 %arg-1%"
                                send "&aYou have given %arg-1% 1 money key&7!" to player
                                send "&aYou have recieved 1 money key&7!" to arg-1
                            else:
                                if arg-2 is "god":
                                    make console execute command "/cc give P god 1 %arg-1%"
                                    send "&aYou have given %arg-1% 1 &cGodly key&7!" to player
                                    send "&aYou have recieved 1 &cGodly key&7!" to arg-1
                                else:
                                    if arg-2 is not "voting":
                                        send "&cInvalid command! &7Maybe try God/Voting/Money?" to player
                                    else:
                                        if arg-2 is not "money":
                                            send "&cInvalid command! &7Maybe try God/Voting/Money?" to player
                                        else:
                                            if arg-2 is not "god":
                                                send "&cInvalid command! &7Maybe try God/Voting/Money?" to player

You need skript to be able to use this script
Installation :
Get skript, Make a new file named "key.sk" or what ever you want, go ingame and write the following command "/sk reload (name)"

have fun​
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

pcranaway

Premium
Feedback score
4
Posts
508
Reactions
148
Resources
0
Wouldn't
Code:
command /key [<offlineplayer>] [<text>]:
    permission: crate.key
    trigger:
        if player doesn't have permission "god.key":
            send "&cYou do not have permissions to execute this command!" to player
        else:
            if arg-1 is not set:
                send "&cInvalid command! &7Maybe try /key (player) (key)" to player
            else:
                if arg-2 is not set:
                    send "&cInvalid command! &7Maybe try /key (player) (key)" to player
                else:
                    if arg-1 is offline:
                        send "&cThe player you specified is currently offline!"
                    else:
                        make console execute command "/cc give P %arg-2% 1 %arg-1%"
                        send "&aYou have given %arg-1% 1 &9%arg-2% key&7!" to player
                        send "&aYou have recieved 1 &9%arg-2% key&7!" to arg-1

work?
i don't have any experience with skript btw
 

Aoid

Feedback score
1
Posts
259
Reactions
58
Resources
0
Wouldn't
Code:
command /key [<offlineplayer>] [<text>]:
    permission: crate.key
    trigger:
        if player doesn't have permission "god.key":
            send "&cYou do not have permissions to execute this command!" to player
        else:
            if arg-1 is not set:
                send "&cInvalid command! &7Maybe try /key (player) (key)" to player
            else:
                if arg-2 is not set:
                    send "&cInvalid command! &7Maybe try /key (player) (key)" to player
                else:
                    if arg-1 is offline:
                        send "&cThe player you specified is currently offline!"
                    else:
                        make console execute command "/cc give P %arg-2% 1 %arg-1%"
                        send "&aYou have given %arg-1% 1 &9%arg-2% key&7!" to player
                        send "&aYou have recieved 1 &9%arg-2% key&7!" to arg-1

work?
i don't have any experience with skript btw
Which skript version do you use?
 
Status
This thread has been locked.
Top