Number generator

Install KtSkript and create a file like config/kt-skript/scripts/my-cool-script.ktskript and put this in there:

registerCommand("roll") {
  action(onlyPlayers = true) {
    val randomNumber = randomInt(start = 1, end = 100)
    val players = player.location.getNearbyEntitiesOfType<Player>(distance = 50.0)
    "&eThe random number is $randomNumber!".t.sendTo(players)
  }
}

Then execute the /roll command, and tweak the things (text, color, number range, max distance to other players).

1 Like