im trying to make a skript (well a twist but whatever) where you can teleport 15 blocks ahead, but it keeps putting the player in the ground, or crashing the server (might be on the cooldown side idk)
here's the code:
if player's off hand item is a nether star named "&7Star of &5&lEnder":
if player has player's off hand item on cooldown:
send action bar "&c&lCOOLDOWN!!!"
else:
set item cooldown of player's off hand item for player to 20 seconds
set {_loc} to location 15 infront of player
while block at {_loc} is air:
set {_t} to 0
if {_t} > 1:
play sound "entity.firework_rocket.large_blast" with volume 1 and pitch 0.5 for all players at {_loc}
set {_t} to 0
wait 1 tick
teleport player to {_loc}
here's the code:
if player's off hand item is a nether star named "&7Star of &5&lEnder":
if player has player's off hand item on cooldown:
send action bar "&c&lCOOLDOWN!!!"
else:
set item cooldown of player's off hand item for player to 20 seconds
set {_loc} to location 15 infront of player
while block at {_loc} is air:
set {_t} to 0
if {_t} > 1:
play sound "entity.firework_rocket.large_blast" with volume 1 and pitch 0.5 for all players at {_loc}
set {_t} to 0
wait 1 tick
teleport player to {_loc}