Hi! I'm trying to make a script on my server so when you do /hub or /lobby it counts down from 3, but if you move the teleportation is canceled. When I try it then it works fine but you still get teleported if you move.
My code is:
Please help!
EDIT: Just don't mind that I used clear instead of setting it to false, I do that sometimes
My code is:
Code:
command /lobby:
aliases: /hub
trigger:
if {_hub::%player%} is not true:
set {_hub::%player%} to true
send "&8&l[&c&lEmpy&e&lrean&8&l] &aTeleporting to lobby! Don't move!"
while {_hub::%player%} is true:
execute command "/title %player% actionbar {""text"":""Teleporting in 3"",""color"":""aqua"",""bold"":true}"
wait 1 second
execute command "/title %player% actionbar {""text"":""Teleporting in 2"",""color"":""aqua"",""bold"":true}"
wait 1 second
execute command "/title %player% actionbar {""text"":""Teleporting in 1"",""color"":""aqua"",""bold"":true}"
wait 1 second
execute command "/title %player% actionbar {""text"":""Teleported!"",""color"":""aqua"",""bold"":true}"
execute command "/mvtp %player% world"
set {_hub::%player%} to false
else:
send "&8&l[&c&lEmpy&e&lrean&8&l] &cYou are already teleporting!" to player
on player move:
if {_hub::%player%} is true:
clear {_hub::%player%}
wait 1 tick
execute command "/title %player% actionbar {""text"":""Teleportation Canceled!"",""color"":""red"",""bold"":true}"
send "&8&l[&c&lEmpy&e&lrean&8&l] &cTeleportation canceled because you moved!" to player
EDIT: Just don't mind that I used clear instead of setting it to false, I do that sometimes