Files
echo-shard.sk
Code
1 44
echo-shard.sk
# Echo Shard knock-up ability
# Right-click while holding an Echo Shard to launch the closest player upward,
# then force them downward.
options:
cooldown: 3 seconds
launch-speed: 1.25
launch-time: 16 ticks
on right click:
if player's tool is not echo shard:
stop
if {echo-shard-cooldown::%uuid of player%} is set:
send "&cEcho Shard is on cooldown." to player
stop
set {echo-shard-cooldown::%uuid of player%} to true
set {_closest-distance} to 999999
delete {_closest-player}
loop all players:
if loop-player is not player:
set {_distance} to distance between player and loop-player
if {_distance} is less than {_closest-distance}:
set {_closest-distance} to {_distance}
set {_closest-player} to loop-player
if {_closest-player} is not set:
send "&cThere are no other players nearby." to player
delete {echo-shard-cooldown::%uuid of player%}
stop
push {_closest-player} upwards at speed {@launch-speed}
send "&5You launched &d%{_closest-player}% &5into the air!" to player
wait {@launch-time}
if {_closest-player} is online:
push {_closest-player} downwards at speed {@launch-speed}
wait {@cooldown}
delete {echo-shard-cooldown::%uuid of player%}