So i want to make a skript that when you click the ticket item on lime wool, it tp you to lime glass but it wont work, can someone help me? Here is my skript
command /giveticket:
permission: pro.ticket
permission message: "&cYou must be a parkour pro to use this command!"
cooldown: 1 minute
cooldown message: "&cYou must wait %remaining time% before using this command again."
trigger:
give player 1 kelp named "&6Ticket"
send "&aYou have been given a Ticket!" to player
on right click:
if player's tool is kelp named "&6Ticket":
if clicked block is lime wool:
set {_loc} to location of clicked block
set {_nearestDistance} to 101
set {_nearestGlass} to null
loop blocks within 100 meters of {_loc}:
if loop-block is lime stained glass:
set {_distance} to distance between {_loc} and loop-block
if {_distance} < {_nearestDistance}:
set {_nearestDistance} to {_distance}
set {_nearestGlass} to loop-block
if {_nearestGlass} is not set:
send "&cNo lime stained glass found within 100 blocks." to player
else:
teleport player to {_nearestGlass}
send "&aTeleported to the nearest lime stained glass!" to player