Command Help.

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

I have had some problem with this.

Can anyone tell me how I could set a permission and a permission message with this code?

command /gmc:
trigger: if gamemode of player is creative:
send "&f[&bFireUHC&f] &9Your gamemode was already creative!" to player
if gamemode of player is survival,adventure or spectator:
set player's gamemode to creative
send "&f[&bFireUHC&f] &9Your gamemode was changed to creative!" to player

command /gms:
trigger:
if gamemode of player is creative,survival or adventure:
set player's gamemode to survival
send "&f[&bFireUHC&f] &9Your gamemode was changed to survival!" to player
if gamemode of player is survival:
send "&f[&bFireUHC&f] &9Your gamemode was already survival!" to player

command /gma:
trigger:
if gamemode of player is creative,survival or spectator:
set player's gamemode to adventure
send "&f[&bFireUHC&f] &9Your gamemode was changed to adventure!" to player
if gamemode of player is adventure:
send "&f[&bFireUHC&f] &9Your gamemode was already adventure!" to player

command /gmsp:
trigger:
if gamemode of player is survival,creative or adventure:
set player's gamemode to spectator
send "&f[&bFireUHC&f] &9Your gamemode was changed to spectator!" to player
if gamemode of player is spectator:
send "&f[&bFireUHC&f] &9Your gamemode was already spectator!" to player

This Skript has no errors but I cant figure out how to give a set permission and message!

Thanks,

- TheCringleYT
 
You get the gist.
Code:
command /gmc:
    permission: this.is.your.permission.node
    permission message:No access to this command.
    trigger:
        if gamemode of player = creative:
            send "&f[&bFireUHC&f] &9Your gamemode was already creative!" to player
        else if gamemode of player isn't creative:
            set player's gamemode to creative
            send "&f[&bFireUHC&f] &9Your gamemode was changed to creative!" to player
 
Surround your code in the right format:
Capture.PNG
 
Hey,

I have had some problem with this.

Can anyone tell me how I could set a permission and a permission message with this code?

command /gmc:
trigger: if gamemode of player is creative:
send "&f[&bFireUHC&f] &9Your gamemode was already creative!" to player
if gamemode of player is survival,adventure or spectator:
set player's gamemode to creative
send "&f[&bFireUHC&f] &9Your gamemode was changed to creative!" to player

command /gms:
trigger:
if gamemode of player is creative,survival or adventure:
set player's gamemode to survival
send "&f[&bFireUHC&f] &9Your gamemode was changed to survival!" to player
if gamemode of player is survival:
send "&f[&bFireUHC&f] &9Your gamemode was already survival!" to player

command /gma:
trigger:
if gamemode of player is creative,survival or spectator:
set player's gamemode to adventure
send "&f[&bFireUHC&f] &9Your gamemode was changed to adventure!" to player
if gamemode of player is adventure:
send "&f[&bFireUHC&f] &9Your gamemode was already adventure!" to player

command /gmsp:
trigger:
if gamemode of player is survival,creative or adventure:
set player's gamemode to spectator
send "&f[&bFireUHC&f] &9Your gamemode was changed to spectator!" to player
if gamemode of player is spectator:
send "&f[&bFireUHC&f] &9Your gamemode was already spectator!" to player

This Skript has no errors but I cant figure out how to give a set permission and message!

Thanks,

- TheCringleYT
Try:
code_language.skript:
command /gmc [<player>]:
    permission: gamemode.creative
    permission message: §cNo permission.
    trigger:
        if arg 1 isn't set:
            set player's gamemode to creative
            message "&aYour game mode has been changed to creative!"
            stop
        else:
            if player has permission "gamemode.creative.others":
                set arg 1's gamemode to creative
                message "&aYou changed the game mode of %arg 1%!" to player
                message "&aYour game mode has been changed to creative!" to arg 1
                stop
            else:
                send "&cNo permission."

command /gms [<player>]:
    permission: gamemode.survival
    permission message: §cNo permission.
    trigger:
        if arg 1 isn't set:
            set player's gamemode to survival
            message "&aYour game mode has been changed to survival!"
            stop
        else:
            if player has permission "gamemode.survival.others":
                set arg 1's gamemode to survival
                message "&aYou changed the game mode of %arg 1%!" to player
                message "&aYour game mode has been changed to survival!" to arg 1
                stop
            else:
                send "&cNo permission."

command /gma [<player>]:
    permission: gamemode.adventure
    permission message: §cNo permission.
    trigger:
        if arg 1 isn't set:
            set player's gamemode to adventure
            message "&aYour game mode has been changed to adventure!"
            stop
        else:
            if player has permission "gamemode.adventure.others":
                set arg 1's gamemode to adventure
                message "&aYou changed the game mode of %arg 1%!" to player
                message "&aYour game mode has been changed to adventure!" to arg 1
                stop
            else:
                send "&cNo permission."

command /gmsp [<player>]:
    permission: gamemode.spectator
    permission message: §cNo permission.
    trigger:
        if arg 1 isn't set:
            set player's gamemode to spectator
            message "&aYour game mode has been changed to spectator!"
            stop
        else:
            if player has permission "gamemode.spectator.others":
                set arg 1's gamemode to spectator
                message "&aYou changed the game mode of %arg 1%!" to player
                message "&aYour game mode has been changed to spectator!" to arg 1
                stop
            else:
                send "&cNo permission."
 
Status
Not open for further replies.