Hello, I have a teleportation script. The problem is that during the teleportation, it lag because of the world generation. I'm looking for a way to generate the map, for example, you can not connect until the map is generated or during the teleportation of the players, the chunks are generated.
Thank you in advance !
Thank you in advance !
code_language.skript:
command /tpall:
trigger:
loop all players:
set {_ok1} to false
while {_ok1} is false:
set {_x} to random number between (0 - 1500) and 1500
set {_y} to 200
set {_z} to random number between (0 - 1500) and 1500
set {_loc} to location({_x}, {_y}, {_z}, world("world"))
set {_ok2} to false
set {_ancienblock} to the block 100 blocks under {_loc}
set block 100 blocks under {_loc} to glass
while {_ok2} is equal to false:
if block at {_loc} is air:
set y coordinate of {_loc} to (y coordinate of {_loc} - 1)
else:
if block at {_loc} is not water:
set {_ok2} to true
set {_ok1} to true
else:
set {_ok2} to true
set y coordinate of {_loc} to 200
teleport loop-player to {_loc}