Finding a player's current position in a skript

  • 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 comminuty!

    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.

DerpoDrago

Member
Jan 15, 2020
10
0
0
22
I'm on version 2.4
I've been trying to set a variable to a player's current position to teleport them back later, but there doesn't seem to be anything like that.
Any help would be appreciated
Code:
on right click with ender pearl:
    set {a} to player's held item
    if {a}'s name is "&a&lZ &r&aTime Pearl":
        set {currentpos} to player's current position
        if player moves from {currentpos}:
            wait 5 seconds
            teleport player to {currentpos}
 
Code:
on right click with ender pearl:
    set {a} to player's held item
    if {a}'s name is "&a&lZ &r&aTime Pearl":
        set {currentpos} to player's location
        loop 60 times:
            if player's location is not {currentpos}:
                wait 5 seconds
                teleport player to {currentpos}
            wait 1 second
 
Hey man, no problem! I love to help people out. :emoji_slight_smile: Make sure to mark this post as solved!
 
Status
Not open for further replies.