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.

Solved Console Executes Random Commands from List of Commands

Discussion in 'Skript' started by khelpire, Feb 22, 2021.

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

    khelpire Member

    Joined:
    Feb 22, 2021
    Messages:
    4
    Likes Received:
    1
    Hello everone, I am really new to skript, I am planning to let console do a single random command among a list of commands after every certain amount of ticks. Here is what I got so far.

    make console execute command "/cmd1"
    make console execute command "/cmd2"
    make console execute command "/cmd3"

    does anyone know how or what code should I use for this to work?

    so in every certain number of ticks, the console will execute a single command from the list of 3 commands above. will really appreciate the help alot! thanks!
     
  2. Nikd0

    Nikd0 Active Member

    Joined:
    May 30, 2020
    Messages:
    202
    Likes Received:
    19
    Code (Text):
    1. every ?? ticks:
    2.     set {_x} to random integer between 1 and 3
    3.     make console execute command "/cmd%{_x}%"
    Eventually, you can use conditions:
    Code (Text):
    1.     if {_x} = 1:
    2.         make console execute "myfancycommand"
    3.     else if {_x} = 2:
    4.         make console execute "myuglycommand"
    5.     else if {_x} = 3: #or just else:
    6.         make console execute "something"
     
    • Winner Winner x 1
  3. khelpire

    khelpire Member

    Joined:
    Feb 22, 2021
    Messages:
    4
    Likes Received:
    1
    Okay thank you so much! will try this out and will provide a feedback here after trying but I think this is what I really need. Thank you appreciate the help alot!
    --- Double Post Merged, Feb 22, 2021, Original Post Date: Feb 22, 2021 ---
    every 60 ticks:
    set {_x} to random integer between 1 and 3
    if {_x} = 1:
    make console execute "broadcast test 1"
    make console execute "broadcast test 1 + 1"
    else if {_x} = 2:
    make console execute "broadcast test 2"
    else if {_x} = 3: #or just else:
    make console execute "broadcast test 3"

    okay just tested it and it works 100% pretty well! thank you once again :emoji_slight_smile:
     
  4. Nikd0

    Nikd0 Active Member

    Joined:
    May 30, 2020
    Messages:
    202
    Likes Received:
    19
    You're welcome! Mark the thread as solved for others :emoji_wink:
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...