Jump to content

Skript teleport to nearest.


kingstyboiYT

Recommended Posts

on right click:
    loop all players:
        add loop-player's location to {locations::*}
    loop {locations::*}:
        set {_distance} to distance between player and loop-value
        if {tpDistance::%player%} is set:
            if {tpDistance::%player%} > {_distance}:
                if loop-value isn't location of player:
                    set {tpDistance::%player%} to {_distance}
                    set {tp::%player%} to loop-value
        else:
            set {tpDistance::%player%} to {_distance}
    teleport player to {tp::%player%}
    delete {locations::*}
    delete {tpDistance::%player%}

 

Edited by ApexSplat

Discord: Dead#6905

Love anime!


Anime Gifs

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...