1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

need to save the position before the player teleports

Discussion in 'Skript' started by otak, Oct 10, 2022.

Tags:
Thread Status:
Not open for further replies.
  1. otak

    otak Member

    Joined:
    Oct 10, 2022
    Messages:
    2
    Likes Received:
    0
    I use multiverse core and when changing the world I need to save the position before the player teleports, for example the player is in world1 use the command to world2 and before teleporting save his last position in world1, how to do it?

    Code (Text):
    1. on player world change:
    2.     wait 10 tick
    3.     if player has permission "op":
    4.         set {LastLocation.%player%} to location of player
    5.         stop
    6.  
    7. command /backtolastlocation:
    8.     permission: op
    9.     trigger:
    10.         if world is "lobby":
    11.             teleport player to {LastLocation.%player%}
    12.         else:
    13.             message "&c Nejsi v lobby"
     
  2. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    139
    Likes Received:
    22
  3. otak

    otak Member

    Joined:
    Oct 10, 2022
    Messages:
    2
    Likes Received:
    0
    I don't understand how to use it, teleportation works for me but it teleports me back to the spawnlobby of the world "zkouska" and not to the last location of the player
    my new code-
    Code (Text):
    1.  
    2. on player world change:
    3. #    if player has permission "op":
    4.     if event-world is "zkouska":
    5.         set {LastLocation::%player%::loc} to event-location
    6.         stop
    7.  
    8. command /backtosurvival:
    9.     permission: op
    10.     trigger:
    11.         if world is "lobby":
    12.             teleport player to {LastLocation::%player%::loc}
    13.         else:
    14.             message "&c Nejsi v lobby"
    15.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...