
Roll Command Skript 1.0.0
Your Random Command As A Dice Roll
RollCommand Skript Documentation
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 totrue
to enable debug messages in the console.
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.
Functionality:
- Permission Check: Verifies if the target player has the
rollcommand.use
permission. - 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.
- Splits the
- 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.
- 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.
- 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.
Debug Mode:
- When
debug
is set totrue
, 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.