1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Run Multiple Commands?

Discussion in 'Skript' started by FallingCatus, Jul 2, 2017.

Thread Status:
Not open for further replies.
  1. FallingCatus

    FallingCatus Member

    Joined:
    Jun 29, 2017
    Messages:
    38
    Likes Received:
    0
    Hey all, Is there a way i can run 2 or more commands in this situation?

    Code (Skript):
    1. 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

     
  2. Best Answer:
    Post #8 by ShaneBee, Jul 2, 2017
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    For this you should use Tuskes advanced gui manger.
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    I use Tuske and I Have been reading the documentation for it and cant seem to find anything that relates to my situation, I may be looking in the wrong place, I am new to Skript, I have looked at This and This
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    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 (Skript):
    1.             create a gui slot 9 of player with iron sword named "&aPvP/Kill Aura Hacks" to close:
    2.                 execute console command "/essentials:smite %arg-1%"
    3.                 wait 2 ticks
    4.                 execute player command "/advancedban:ban %arg-1%"
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    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 (Skript):
    1. command /test:
    2.     trigger:
    3.         create new gui with id "test" with virtual chest with 3 rows named "Test":
    4.             make gui slot 0 with cobblestone named "Test" with lore "Test":
    5.                 #command when they click the cobblestone
    6.                 #something else to happen
    7.                 #more stuff you want to happen when they click it
    8.             make gui slot 1 with dirt named "Test" with lore "Test":
    9.                 #stuff that happens when they click the dirt
    10.                 #put as much stuff here as you want
    11.  
    12.         open gui "test" to player
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Sorry, what i mean is...

    when i have it the way i had it before like this...
    Code (Skript):
    1.         if arg-1 is set:
    2.             open virtual chest inventory with 3 rows named "&cPerm Ban: &a%arg-1%" to player
    3.             wait 1 tick
    4.             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 (Skript):
    1.         if arg-1 is set:
    2.             open virtual chest inventory with 3 rows named "&cPerm Ban: &a%arg-1%" to player
    3.             wait 1 tick
    4.             create a gui slot 9 of player with iron sword named "&aPvP/Kill Aura Hacks":
    5.                 execute console command "/essentials:smite %arg-1%"
    6.                 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
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    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}%
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Yeah it is weird, I will try creating a variable now, Thanks
    --- Double Post Merged, Jul 2, 2017, Original Post Date: Jul 2, 2017 ---
    Seems like that done the trick, not sure why it would not find it as arg-1, Thanks again Donut
     
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    TuSKe can't use event values there, which is why arguments don't work.
     
    FallingCatus likes this.
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    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 (Skript):
    1. command /ban [<offline player>] [<text>]:
    2.     permission: smpban.use
    3.     permission message: &c&lSMP&f&lAdmin &8> &aNice try! &7Only our staff have this permission.
    4.  
    5.     trigger:
    6.         wait 2 ticks
    7.         if arg-1 is not set:
    8.             send "&c&lSMP&f&lAdmin &8> &6/ban &7<player>"
    9.         if arg-1 is set:
    10.             open virtual chest inventory with 3 rows named "&c&lSMP&f&lAdmin &7Ban Hammer " to player
    11.             wait 1 tick
    12.             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}%"
    13.             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}%"
    14.  
    15. command /smpadminban [<offline player>] [<text>]:
    16.     permission: smpban.use
    17.     permission message: &c&lSMP&f&lAdmin &8> &aNice try! &7Only our staff have this permission.
    18.     trigger:
    19.         set {banplayer} to arg-1
    20.         wait 2 ticks
    21.         if arg-1 is not set:
    22.             send "&c&lSMP&f&lAdmin &8> &6/ban &7<player>"
    23.         if arg-1 is set:
    24.             open virtual chest inventory with 3 rows named "&cPerm Ban: &a%{banplayer}%" to player
    25.             wait 1 tick
    26.             create a gui slot 9 of player with iron sword named "&aPvP/Kill Aura Hacks" to close:
    27.                 execute console command "/essentials:smite %{banplayer}%"
    28.                 wait 5 ticks
    29.                 execute console command "/essentials:smite %{banplayer}%"
    30.                 wait 5 ticks
    31.                 execute console command "/essentials:smite %{banplayer}%"
    32.                 wait 5 ticks
    33.                 execute player command "/advancedban:ban %{banplayer}% PvP/Kill Aura Hacks"
    34.             create a gui slot 10 of player with feather named "&aFly/Speed/Water Hacking" to close:
    35.                 execute console command "/essentials:smite %{banplayer}%"
    36.                 wait 5 ticks
    37.                 execute console command "/essentials:smite %{banplayer}%"
    38.                 wait 5 ticks
    39.                 execute console command "/essentials:smite %{banplayer}%"
    40.                 wait 5 ticks
    41.                 execute player command "/advancedban:ban %{banplayer}% Fly/Speed/Water Hacking"
    42.             create a gui slot 11 of player with diamond named "&aX-Ray" to close:
    43.                 execute console command "/essentials:smite %{banplayer}%"
    44.                 wait 5 ticks
    45.                 execute console command "/essentials:smite %{banplayer}%"
    46.                 wait 5 ticks
    47.                 execute console command "/essentials:smite %{banplayer}%"
    48.                 wait 5 ticks
    49.                 execute player command "/advancedban:ban %{banplayer}% X-Ray"
    50.             create a gui slot 12 of player with compass named "&aAdvertising" to close:
    51.                 execute console command "/essentials:smite %{banplayer}%"
    52.                 wait 5 ticks
    53.                 execute console command "/essentials:smite %{banplayer}%"
    54.                 wait 5 ticks
    55.                 execute console command "/essentials:smite %{banplayer}%"
    56.                 wait 5 ticks
    57.                 execute player command "/advancedban:ban %{banplayer}% Advertising"
    58.             create a gui slot 13 of player with creeper head named "&aStaff Impersonation/Disrespect" to close:
    59.                 execute console command "/essentials:smite %{banplayer}%"
    60.                 wait 5 ticks
    61.                 execute console command "/essentials:smite %{banplayer}%"
    62.                 wait 5 ticks
    63.                 execute console command "/essentials:smite %{banplayer}%"
    64.                 wait 5 ticks
    65.                 execute player command "/advancedban:ban %{banplayer}% Staff Impersonation/Disrespect"
    66.             create a gui slot 14 of player with Book and Quill named "&aSpam/Racism/Harassment/Sexism/Threats/KYS" to close:
    67.                 execute console command "/essentials:smite %{banplayer}%"
    68.                 wait 5 ticks
    69.                 execute console command "/essentials:smite %{banplayer}%"
    70.                 wait 5 ticks
    71.                 execute console command "/essentials:smite %{banplayer}%"
    72.                 wait 5 ticks
    73.                 execute player command "/advancedban:ban %{banplayer}% Spam/Racism/Harassment/Sexism/Threats/KYS"
    74.             create a gui slot 15 of player with tnt named "&aGriefing" to close:
    75.                 execute console command "/essentials:smite %{banplayer}%"
    76.                 wait 5 ticks
    77.                 execute console command "/essentials:smite %{banplayer}%"
    78.                 wait 5 ticks
    79.                 execute console command "/essentials:smite %{banplayer}%"
    80.                 wait 5 ticks
    81.                 execute player command "/advancedban:ban %{banplayer}% Griefing"
    82.             create a gui slot 16 of player with ender chest named "&aExploiting &7(Please remove items/money)" to close:
    83.                 execute console command "/essentials:smite %{banplayer}%"
    84.                 wait 5 ticks
    85.                 execute console command "/essentials:smite %{banplayer}%"
    86.                 wait 5 ticks
    87.                 execute console command "/essentials:smite %{banplayer}%"
    88.                 wait 5 ticks
    89.                 execute player command "/advancedban:ban %{banplayer}% Exploiting"
    90.             create a gui slot 17 of player with cobweb named "&aOther/Unspecified" to close:
    91.                 execute console command "/essentials:smite %{banplayer}%"
    92.                 wait 5 ticks
    93.                 execute console command "/essentials:smite %{banplayer}%"
    94.                 wait 5 ticks
    95.                 execute console command "/essentials:smite %{banplayer}%"
    96.                 wait 5 ticks
    97.                 execute player command "/advancedban:ban %{banplayer}% Other/Unspecified"
    98.  
    99. command /smpadmintempban [<offline player>] [<text>]:
    100.     permission: smpban.use
    101.     permission message: &c&lSMP&f&lAdmin &8> &aNice try! &7Only our staff have this permission.
    102.     trigger:
    103.         set {banplayer} to arg-1
    104.         wait 2 tick
    105.         if arg-1 is not set:
    106.             send "&c&lSMP&f&lAdmin &r&8> &6/tempban &7<player>"
    107.         if arg-1 is set:
    108.             open virtual chest inventory with 5 rows named "&eTemp Ban: &a%{banplayer}%" to player
    109.             wait 1 tick
    110.             create a gui slot 9 of player with iron sword named "&aPvP/Kill Aura Hacks" with lore "&e7 Days" to close:
    111.                 execute console command "/essentials:smite %{banplayer}%"
    112.                 wait 5 ticks
    113.                 execute console command "/essentials:smite %{banplayer}%"
    114.                 wait 5 ticks
    115.                 execute console command "/essentials:smite %{banplayer}%"
    116.                 wait 5 ticks
    117.                 execute player command "/advancedban:tempban %{banplayer}% 7d PvP/Kill Aura Hacks"
    118.             create a gui slot 10 of player with feather named "&aFly/Speed/Water Hacking" with lore "&e7 Days" to close:
    119.                 execute console command "/essentials:smite %{banplayer}%"
    120.                 wait 5 ticks
    121.                 execute console command "/essentials:smite %{banplayer}%"
    122.                 wait 5 ticks
    123.                 execute console command "/essentials:smite %{banplayer}%"
    124.                 wait 5 ticks
    125.                 execute player command "/advancedban:tempban %{banplayer}% 7d Fly/Speed/Water Hacking"
    126.             create a gui slot 11 of player with diamond named "&aX-Ray" with lore "&e7 Days" to close:
    127.                 execute console command "/essentials:smite %{banplayer}%"
    128.                 wait 5 ticks
    129.                 execute console command "/essentials:smite %{banplayer}%"
    130.                 wait 5 ticks
    131.                 execute console command "/essentials:smite %{banplayer}%"
    132.                 wait 5 ticks
    133.                 execute player command "/advancedban:tempban %{banplayer}% 7d X-Ray"
    134.             create a gui slot 12 of player with compass named "&aAdvertising" with lore "&e7 Days" to close:
    135.                 execute console command "/essentials:smite %{banplayer}%"
    136.                 wait 5 ticks
    137.                 execute console command "/essentials:smite %{banplayer}%"
    138.                 wait 5 ticks
    139.                 execute console command "/essentials:smite %{banplayer}%"
    140.                 wait 5 ticks
    141.                 execute player command "/advancedban:tempban %{banplayer}% 7d Advertising"
    142.             create a gui slot 13 of player with creeper head named "&aStaff Impersonation/Disrespect" with lore "&e7 Days" to close:
    143.                 execute console command "/essentials:smite %{banplayer}%"
    144.                 wait 5 ticks
    145.                 execute console command "/essentials:smite %{banplayer}%"
    146.                 wait 5 ticks
    147.                 execute console command "/essentials:smite %{banplayer}%"
    148.                 wait 5 ticks
    149.                 execute player command "/advancedban:tempban %{banplayer}% 7d Staff Impersonation/Disrespect"
    150.             create a gui slot 14 of player with Book and Quill named "&aSpam/Racism/Harassment/Sexism/Threats/KYS" with lore "&e7 Days" to close:
    151.                 execute console command "/essentials:smite %{banplayer}%"
    152.                 wait 5 ticks
    153.                 execute console command "/essentials:smite %{banplayer}%"
    154.                 wait 5 ticks
    155.                 execute console command "/essentials:smite %{banplayer}%"
    156.                 wait 5 ticks
    157.                 execute player command "/advancedban:tempban %{banplayer}% 7d Spam/Racism/Harassment/Sexism/Threats/KYS"
    158.             create a gui slot 15 of player with tnt named "&aGriefing" with lore "&e7 Days" to close:
    159.                 execute console command "/essentials:smite %{banplayer}%"
    160.                 wait 5 ticks
    161.                 execute console command "/essentials:smite %{banplayer}%"
    162.                 wait 5 ticks
    163.                 execute console command "/essentials:smite %{banplayer}%"
    164.                 wait 5 ticks
    165.                 execute player command "/advancedban:tempban %{banplayer}% 7d Griefing"
    166.             create a gui slot 16 of player with ender chest named "&aExploiting  &7(Please remove items/money)" with lore "&e7 Days" to close:
    167.                 execute console command "/essentials:smite %{banplayer}%"
    168.                 wait 5 ticks
    169.                 execute console command "/essentials:smite %{banplayer}%"
    170.                 wait 5 ticks
    171.                 execute console command "/essentials:smite %{banplayer}%"
    172.                 wait 5 ticks
    173.                 execute player command "/advancedban:tempban %{banplayer}% 7d Exploiting"
    174.             create a gui slot 17 of player with cobweb named "&aOther/Unspecified" with lore "&e7 Days" to close:
    175.                 execute console command "/essentials:smite %{banplayer}%"
    176.                 wait 5 ticks
    177.                 execute console command "/essentials:smite %{banplayer}%"
    178.                 wait 5 ticks
    179.                 execute console command "/essentials:smite %{banplayer}%"
    180.                 wait 5 ticks
    181.                 execute player command "/advancedban:tempban %{banplayer}% 7d Other/Unspecified"
    182.             create a gui slot 27 of player with iron sword named "&aPvP/Kill Aura Hacks" with lore "&e14 Days" to close:
    183.                 execute console command "/essentials:smite %{banplayer}%"
    184.                 wait 5 ticks
    185.                 execute console command "/essentials:smite %{banplayer}%"
    186.                 wait 5 ticks
    187.                 execute console command "/essentials:smite %{banplayer}%"
    188.                 wait 5 ticks
    189.                 execute player command "/advancedban:tempban %{banplayer}% 14d PvP/Kill Aura Hacks"
    190.             create a gui slot 28 of player with feather named "&aFly/Speed/Water Hacking" with lore "&e14 Days" to close:
    191.                 execute console command "/essentials:smite %{banplayer}%"
    192.                 wait 5 ticks
    193.                 execute console command "/essentials:smite %{banplayer}%"
    194.                 wait 5 ticks
    195.                 execute console command "/essentials:smite %{banplayer}%"
    196.                 wait 5 ticks
    197.                 execute player command "/advancedban:tempban %{banplayer}% 14d Fly/Speed/Water Hacking"
    198.             create a gui slot 29 of player with diamond named "&aX-Ray" with lore "&e14 Days" to close:
    199.                 execute console command "/essentials:smite %{banplayer}%"
    200.                 wait 5 ticks
    201.                 execute console command "/essentials:smite %{banplayer}%"
    202.                 wait 5 ticks
    203.                 execute console command "/essentials:smite %{banplayer}%"
    204.                 wait 5 ticks
    205.                 execute player command "/advancedban:tempban %{banplayer}% 14d X-Ray"
    206.             create a gui slot 30 of player with compass named "&aAdvertising" with lore "&e14 Days" to close:
    207.                 execute console command "/essentials:smite %{banplayer}%"
    208.                 wait 5 ticks
    209.                 execute console command "/essentials:smite %{banplayer}%"
    210.                 wait 5 ticks
    211.                 execute console command "/essentials:smite %{banplayer}%"
    212.                 wait 5 ticks
    213.                 execute player command "/advancedban:tempban %{banplayer}% 14d Advertising"
    214.             create a gui slot 31 of player with creeper head named "&aStaff Impersonation/Disrespect" with lore "&e14 Days" to close:
    215.                 execute console command "/essentials:smite %{banplayer}%"
    216.                 wait 5 ticks
    217.                 execute console command "/essentials:smite %{banplayer}%"
    218.                 wait 5 ticks
    219.                 execute console command "/essentials:smite %{banplayer}%"
    220.                 wait 5 ticks
    221.                 execute player command "/advancedban:tempban %{banplayer}% 14d Staff Impersonation/Disrespect"
    222.             create a gui slot 32 of player with Book and Quill named "&aSpam/Racism/Harassment/Sexism/Threats/KYS" with lore "&e14 Days" to close:
    223.                 execute console command "/essentials:smite %{banplayer}%"
    224.                 wait 5 ticks
    225.                 execute console command "/essentials:smite %{banplayer}%"
    226.                 wait 5 ticks
    227.                 execute console command "/essentials:smite %{banplayer}%"
    228.                 wait 5 ticks
    229.                 execute player command "/advancedban:tempban %{banplayer}% 14d Spam/Racism/Harassment/Sexism/Threats/KYS"
    230.             create a gui slot 33 of player with tnt named "&aGriefing" with lore "&e14 Days" to close:
    231.                 execute console command "/essentials:smite %{banplayer}%"
    232.                 wait 5 ticks
    233.                 execute console command "/essentials:smite %{banplayer}%"
    234.                 wait 5 ticks
    235.                 execute console command "/essentials:smite %{banplayer}%"
    236.                 wait 5 ticks
    237.                 execute player command "/advancedban:tempban %{banplayer}% 14d Griefing"
    238.             create a gui slot 34 of player with ender chest named "&aExploiting  &7(Please remove items/money)" with lore "&e14 Days" to close:
    239.                 execute console command "/essentials:smite %{banplayer}%"
    240.                 wait 5 ticks
    241.                 execute console command "/essentials:smite %{banplayer}%"
    242.                 wait 5 ticks
    243.                 execute console command "/essentials:smite %{banplayer}%"
    244.                 wait 5 ticks
    245.                 execute player command "/advancedban:tempban %{banplayer}% 14d Exploiting"
    246.             create a gui slot 35 of player with cobweb named "&aOther/Unspecified" with lore "&e14 Days" to close:
    247.                 execute console command "/essentials:smite %{banplayer}%"
    248.                 wait 5 ticks
    249.                 execute console command "/essentials:smite %{banplayer}%"
    250.                 wait 5 ticks
    251.                 execute console command "/essentials:smite %{banplayer}%"
    252.                 wait 5 ticks
    253.                 execute player command "/advancedban:tempban %{banplayer}% 14d Other/Unspecified"
     
  13. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Hmm try deleting {banplayer} before setting it or use a local variable {_banplayer}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...