I currently have a /warps skript with several warps with a cooldown of 30 minutes everytime someone uses this command. But my issue is if someone was to leave this inventory, the cooldown would still start. Anyone know how to fix this? also I tried adding cooldown cancel after send "&cCould not teleport you to Europe" to player but it didn't work. Anyone know how I can add a cooldown cancel if the else statement happens?
My questions:
1) How to add a cooldown cancel when a player exits the inventory gui
2) How to add a cooldown cancel when the else statement happens
My questions:
1) How to add a cooldown cancel when a player exits the inventory gui
2) How to add a cooldown cancel when the else statement happens
Code:
command /warps:
cooldown: 30 minutes
cooldown message: &ePlease wait %remaining time% to use /warps again
trigger:
open virtual chest with 1 rows named "&a&lWarps" to player
format gui slot 1 of player with Grass block named "&aEurope" to run:
send "&aStand still for 3 seconds to be teleported to Europe"
close player's inventory
set {_x} to x-coords of player
set {_z} to z-coords of player
wait 3 seconds
set {_x-now} to x-coords of player
set {_z-now} to z-coords of player
if {_x-now} = {_x}:
if {_z-now} = {_z}:
send "&aYou have successfully been teleported to Europe"
teleport player to location 3752, 123, -10560 in world "GCEarth"
else:
send "&cCould not teleport you to Europe" to player
stop