Run Multiple Commands?

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

FallingCatus

Member
Jun 29, 2017
38
0
6
33
Hey all, Is there a way i can run 2 or more commands in this situation?

code_language.skript:
create a gui slot 9 of player with iron sword named "&aPvP/Kill Aura Hacks" to run player command "/advancedban:ban %arg-1%"

I would like it to run a console /smite arg-1 then run the ban command but I can not find a way to do this playing around with it or in the documentation.

Thanks
 
Thanks I think i found what i needed but the arg-1 does not seem to be carrying over, does this look right to you?

code_language.skript:
            create a gui slot 9 of player with iron sword named "&aPvP/Kill Aura Hacks" to close:
                execute console command "/essentials:smite %arg-1%"
                wait 2 ticks
                execute player command "/advancedban:ban %arg-1%"
 
What do you mean arg-1 doesn't carry over?

It seems like you're combining the simple and advanced gui syntax. Here's a rough outline of what an advanced gui (which is what i think you want) should look like:

code_language.skript:
command /test:
    trigger:
        create new gui with id "test" with virtual chest with 3 rows named "Test":
            make gui slot 0 with cobblestone named "Test" with lore "Test":
                #command when they click the cobblestone
                #something else to happen
                #more stuff you want to happen when they click it
            make gui slot 1 with dirt named "Test" with lore "Test":
                #stuff that happens when they click the dirt
                #put as much stuff here as you want

        open gui "test" to player
 
What do you mean arg-1 doesn't carry over?

It seems like you're combining the simple and advanced gui syntax. Here's a rough outline of what an advanced gui (which is what i think you want) should look like:

code_language.skript:
command /test:
    trigger:
        create new gui with id "test" with virtual chest with 3 rows named "Test":
            make gui slot 0 with cobblestone named "Test" with lore "Test":
                #command when they click the cobblestone
                #something else to happen
                #more stuff you want to happen when they click it
            make gui slot 1 with dirt named "Test" with lore "Test":
                #stuff that happens when they click the dirt
                #put as much stuff here as you want

        open gui "test" to player
Sorry, what i mean is...

when i have it the way i had it before like this...
code_language.skript:
        if arg-1 is set:
            open virtual chest inventory with 3 rows named "&cPerm Ban: &a%arg-1%" to player
            wait 1 tick
            create a gui slot 9 of player with iron sword named "&aPvP/Kill Aura Hacks" execute player command "/advancedban:ban %arg-1%"
the command runs fine and will ban the player (arg-1)

But when i change it to to run multiple commands like this...
code_language.skript:
        if arg-1 is set:
            open virtual chest inventory with 3 rows named "&cPerm Ban: &a%arg-1%" to player
            wait 1 tick
            create a gui slot 9 of player with iron sword named "&aPvP/Kill Aura Hacks":
                execute console command "/essentials:smite %arg-1%"
                execute player command "/advancedban:ban %arg-1%"
I does not ban the player and says that the UUID of (none) can not be found, so its like its forgetting arg-1
 
So in line 6 it thinks arg-1 is none? Does it work in line 5? I guess you could try setting arg-1 to a variable then try banning %{variable}%
 
So in line 6 it thinks arg-1 is none? Does it work in line 5? I guess you could try setting arg-1 to a variable then try banning %{variable}%
Yeah it is weird, I will try creating a variable now, Thanks
[doublepost=1499018563,1499017238][/doublepost]
So in line 6 it thinks arg-1 is none? Does it work in line 5? I guess you could try setting arg-1 to a variable then try banning %{variable}%
Seems like that done the trick, not sure why it would not find it as arg-1, Thanks again Donut
 
Seem to have a new problem now, When i put /ban PLAYERNAME it shows the player i first banned when i loaded the server, so lets say i start the server and ban "player1" that works fine then later on i try ban "player2" I comes "player1" in the %{banplayer}% variable instead of "player2" meaning if i try ban that player it says "player1 is already banned" and i can not ban any other player, Any ideas?

code_language.skript:
command /ban [<offline player>] [<text>]:
    permission: smpban.use
    permission message: &c&lSMP&f&lAdmin &8> &aNice try! &7Only our staff have this permission.

    trigger:
        wait 2 ticks
        if arg-1 is not set:
            send "&c&lSMP&f&lAdmin &8> &6/ban &7<player>"
        if arg-1 is set:
            open virtual chest inventory with 3 rows named "&c&lSMP&f&lAdmin &7Ban Hammer " to player
            wait 1 tick
            create a gui slot 11 of player with yellow glass pane named "&e&lTemp Ban: &a%{banplayer}%" with lore "&7Click to select" to run player command "skript:smpadmintempban %{banplayer}%"
            create a gui slot 15 of player with red glass pane named "&c&lPerm Ban: &a%{banplayer}%" with lore "&7Click to select" to run player command "skript:smpadminban %{banplayer}%"

command /smpadminban [<offline player>] [<text>]:
    permission: smpban.use
    permission message: &c&lSMP&f&lAdmin &8> &aNice try! &7Only our staff have this permission.
    trigger:
        set {banplayer} to arg-1
        wait 2 ticks
        if arg-1 is not set:
            send "&c&lSMP&f&lAdmin &8> &6/ban &7<player>"
        if arg-1 is set:
            open virtual chest inventory with 3 rows named "&cPerm Ban: &a%{banplayer}%" to player
            wait 1 tick
            create a gui slot 9 of player with iron sword named "&aPvP/Kill Aura Hacks" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:ban %{banplayer}% PvP/Kill Aura Hacks"
            create a gui slot 10 of player with feather named "&aFly/Speed/Water Hacking" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:ban %{banplayer}% Fly/Speed/Water Hacking"
            create a gui slot 11 of player with diamond named "&aX-Ray" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:ban %{banplayer}% X-Ray"
            create a gui slot 12 of player with compass named "&aAdvertising" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:ban %{banplayer}% Advertising"
            create a gui slot 13 of player with creeper head named "&aStaff Impersonation/Disrespect" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:ban %{banplayer}% Staff Impersonation/Disrespect"
            create a gui slot 14 of player with Book and Quill named "&aSpam/Racism/Harassment/Sexism/Threats/KYS" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:ban %{banplayer}% Spam/Racism/Harassment/Sexism/Threats/KYS"
            create a gui slot 15 of player with tnt named "&aGriefing" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:ban %{banplayer}% Griefing"
            create a gui slot 16 of player with ender chest named "&aExploiting &7(Please remove items/money)" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:ban %{banplayer}% Exploiting"
            create a gui slot 17 of player with cobweb named "&aOther/Unspecified" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:ban %{banplayer}% Other/Unspecified"

command /smpadmintempban [<offline player>] [<text>]:
    permission: smpban.use
    permission message: &c&lSMP&f&lAdmin &8> &aNice try! &7Only our staff have this permission.
    trigger:
        set {banplayer} to arg-1
        wait 2 tick
        if arg-1 is not set:
            send "&c&lSMP&f&lAdmin &r&8> &6/tempban &7<player>"
        if arg-1 is set:
            open virtual chest inventory with 5 rows named "&eTemp Ban: &a%{banplayer}%" to player
            wait 1 tick
            create a gui slot 9 of player with iron sword named "&aPvP/Kill Aura Hacks" with lore "&e7 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 7d PvP/Kill Aura Hacks"
            create a gui slot 10 of player with feather named "&aFly/Speed/Water Hacking" with lore "&e7 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 7d Fly/Speed/Water Hacking"
            create a gui slot 11 of player with diamond named "&aX-Ray" with lore "&e7 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 7d X-Ray"
            create a gui slot 12 of player with compass named "&aAdvertising" with lore "&e7 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 7d Advertising"
            create a gui slot 13 of player with creeper head named "&aStaff Impersonation/Disrespect" with lore "&e7 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 7d Staff Impersonation/Disrespect"
            create a gui slot 14 of player with Book and Quill named "&aSpam/Racism/Harassment/Sexism/Threats/KYS" with lore "&e7 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 7d Spam/Racism/Harassment/Sexism/Threats/KYS"
            create a gui slot 15 of player with tnt named "&aGriefing" with lore "&e7 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 7d Griefing"
            create a gui slot 16 of player with ender chest named "&aExploiting  &7(Please remove items/money)" with lore "&e7 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 7d Exploiting"
            create a gui slot 17 of player with cobweb named "&aOther/Unspecified" with lore "&e7 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 7d Other/Unspecified"
            create a gui slot 27 of player with iron sword named "&aPvP/Kill Aura Hacks" with lore "&e14 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 14d PvP/Kill Aura Hacks"
            create a gui slot 28 of player with feather named "&aFly/Speed/Water Hacking" with lore "&e14 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 14d Fly/Speed/Water Hacking"
            create a gui slot 29 of player with diamond named "&aX-Ray" with lore "&e14 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 14d X-Ray"
            create a gui slot 30 of player with compass named "&aAdvertising" with lore "&e14 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 14d Advertising"
            create a gui slot 31 of player with creeper head named "&aStaff Impersonation/Disrespect" with lore "&e14 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 14d Staff Impersonation/Disrespect"
            create a gui slot 32 of player with Book and Quill named "&aSpam/Racism/Harassment/Sexism/Threats/KYS" with lore "&e14 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 14d Spam/Racism/Harassment/Sexism/Threats/KYS"
            create a gui slot 33 of player with tnt named "&aGriefing" with lore "&e14 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 14d Griefing"
            create a gui slot 34 of player with ender chest named "&aExploiting  &7(Please remove items/money)" with lore "&e14 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 14d Exploiting"
            create a gui slot 35 of player with cobweb named "&aOther/Unspecified" with lore "&e14 Days" to close:
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute console command "/essentials:smite %{banplayer}%"
                wait 5 ticks
                execute player command "/advancedban:tempban %{banplayer}% 14d Other/Unspecified"
 
Status
Not open for further replies.