Voxel Shop beta is live. Expect occasional bugs. Learn more  
Roll Command Skript icon

Roll Command Skript 1.0.0

Your Random Command As A Dice Roll

RollCommand Skript Documentation


Asset-3cat.png


Purpose: Executes a randomly selected command from a comma-separated list.


 


Configuration (Options):



  • permission: rollcommand.use - Permission required to use the command.
  • prefix: &7[&bRollCommand&7] - Prefix for command messages.
  • debug: false - Set to true to enable debug messages in the console.

cb952172b598716424dcfac602ba0690.gif


f341d1fcb3f002ec580ee1c1e0cca375.png


Command: /rollcommand [<player>] <commands>


Arguments:



  • [<player>]: The target player. If omitted, the command targets the sender.
  • <commands>: A comma-separated list of console commands to choose from.

2da8a4c323648363b21d2e4ebde63e31.png


Functionality:



  1. Permission Check: Verifies if the target player has the rollcommand.use permission.
  2. Command Parsing:

    • Splits the <commands> argument into a list of individual commands using commas as separators.
    • If no commands are provided, an error message is sent.
  3. Random Selection:

    • Generates a random integer within the range of the number of provided commands.
    • If debug mode is enabled, the command list and random number are sent to console.
  4. Command Execution:

    • Selects the command corresponding to the randomly generated index.
    • If debug mode is enabled, the command about to be executed is sent to console.
    • Executes the selected command as the console.
  5. Error Handling:

    • If no commands are provided, an error message is sent.
    • If the player lacks permission, an error message is sent.

Usage Examples:



  • /rollcommand say Hello,say Goodbye,time set day: Executes one of the three commands randomly.
  • /rollcommand Player1 tp 100 64 100,say Player1 has been teleported: Executes one of the two commands randomly targeting Player1.

0f5db08283d20f3e9b5389a871b805e6.png


Debug Mode:



  • When debug is set to true, the following information is sent to the console:

    • The list of parsed commands.
    • The randomly generated number.
    • The command that is about to be executed.
    • A message that displays the player who rolled, the number they rolled, and the command that was executed.
Sign in
$2.00 USD
Sign in to purchase, save this product to your cart, and keep downloads tied to your account.
Stripe

skript

random

dice

commands