From faf8b00297a9d450891e30a6a5616fc304dcf5bc Mon Sep 17 00:00:00 2001 From: Overfake <34581374+Overfake@users.noreply.github.com> Date: Thu, 22 Nov 2018 07:42:24 +0100 Subject: [PATCH 1/2] Create tpalea.ktskript A script to random tp yourself between 2000 to 5000 blocks from where you are. Only people with permission "tpalea" will be able to tp. You can add an integer as argument to change the number of blocks, just do as in the other script called : admpw.ktskript --- example-scripts/simple/tpalea.ktskript | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 example-scripts/simple/tpalea.ktskript diff --git a/example-scripts/simple/tpalea.ktskript b/example-scripts/simple/tpalea.ktskript new file mode 100644 index 0000000..4f31724 --- /dev/null +++ b/example-scripts/simple/tpalea.ktskript @@ -0,0 +1,9 @@ +registerCommand("tpalea") +{ + permission("tpalea.perm") + action(onlyPlayers = true) + { + val command = "execute @a[name=${player.name}] ~ ~ ~ /spreadplayers ~ ~ 2000 5000 false @s" + Server.console.executeCommand(command) + } +} From c88728bfe9f7516b9527880479667f7f2f4836dc Mon Sep 17 00:00:00 2001 From: Overfake <34581374+Overfake@users.noreply.github.com> Date: Thu, 22 Nov 2018 16:36:52 +0100 Subject: [PATCH 2/2] Update tpalea.ktskript Added a new command which takes as argument a player for staff if an admin wants to tp a player randomly /tpaleap PLAYER_USERNAME --- example-scripts/simple/tpalea.ktskript | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/example-scripts/simple/tpalea.ktskript b/example-scripts/simple/tpalea.ktskript index 4f31724..c11dfd0 100644 --- a/example-scripts/simple/tpalea.ktskript +++ b/example-scripts/simple/tpalea.ktskript @@ -3,7 +3,18 @@ registerCommand("tpalea") permission("tpalea.perm") action(onlyPlayers = true) { - val command = "execute @a[name=${player.name}] ~ ~ ~ /spreadplayers ~ ~ 2000 5000 false @s" - Server.console.executeCommand(command) + val command = "execute @a[name=${player.name}] ~ ~ ~ /spreadplayers ~ ~ 2000 5000 false @s" + Server.console.executeCommand(command) + } +} +registerCommand("tpaleap") +{ + permission("tpaleap.perm") + arguments(player("player")) + action(onlyPlayers = true) + { + val p = argument("player") + val command = "execute @a[name=${p.name}] ~ ~ ~ /spreadplayers ~ ~ 2000 5000 false @p[name=${p.name}]" + Server.console.executeCommand(command) } }