Solved Chunk generator

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Aralwen

Active Member
May 26, 2017
164
14
18
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 !

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}
 
teleport loop-player to {_loc} <-- do it right before this, like:


load chunk chunk at location of {_loc}
wait 1 second
teleport loop-player to {_loc}
 
Status
Not open for further replies.