im making an rtpqueue skript but im running into a problem when the block location that the skript randomly finds doesnt follow the requirements of not being water, air, or sand, and it just stops. i dont know how to make it continously check, can anyone give some advice on how i do it?
command /rtpqueue:
trigger:
if {rtpqueue::looking::searching::%player%} is not set:
add 1 to {rtpqueue::looking}
set {rtpqueue::looking::%player%} to player
send "&aYou're now looking for an RTP fight. Use &7/rtpqueue &ato &cleave &aqueue." to player
send "&aThere are currently &f%{rtpqueue::looking}% &aplayer(s) in queue."
set {rtpqueue::looking::searching::%player%} to true
if {rtpqueue::looking} is greater than 1:
set {x} to random number between -5000 and 5000
set {z} to random number between -5000 and 5000
set {rtplocation} to highest block at location ({x}, 0, {z})
loop all blocks above {rtplocation}:
if loop-block is air:
block below loop-block is not water[]
block below loop-block is not air
block below loop-block is sand
if block above loop-block is air:
teleport {rtpqueue::looking::*} to block above {rtplocation}
send action bar "&aYou've been teleported for an RTP fight!" to {rtpqueue::looking::*}
send "&aYou've been teleported for an RTP fight!" to {rtpqueue::looking::*}
clear {rtpqueue::looking}
clear {rtpqueue::looking::*}
clear {rtpqueue::looking::searching::%player%}