skript world variables

  • 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.

dudle

Active Member
Jan 31, 2017
135
0
16
45
Is there a way to make location variables (which are set in a specific world) be saved and not reset if the world where the variable was set is unloaded or is removed?
 
Is there a way to make location variables (which are set in a specific world) be saved and not reset if the world where the variable was set is unloaded or is removed?
You can make 2 seperate variables: 1 with a vector with the x, y and z coordinate of the location. Another variable with the world, but as a string. Then you can use the location at expression to get the location whenever you need it
 
Code:
command /setpos [<integer>]:
    trigger:
        if arg 1 is 1:
            set {pos1} to location of player
            stop
        if arg 1 is 2:
            set {pos2} to location of player
            stop

command /tppos [<integer>]:
    trigger:
        if arg 1 is 1:
            teleport player to {pos1}
            stop
        if arg 1 is 2:
            teleport player to {pos2}
            stop
 
You can make 2 seperate variables: 1 with a vector with the x, y and z coordinate of the location. Another variable with the world, but as a string. Then you can use the location at expression to get the location whenever you need it
thanks, i'll try that

Code:
command /setpos [<integer>]:
    trigger:
        if arg 1 is 1:
            set {pos1} to location of player
            stop
        if arg 1 is 2:
            set {pos2} to location of player
            stop

command /tppos [<integer>]:
    trigger:
        if arg 1 is 1:
            teleport player to {pos1}
            stop
        if arg 1 is 2:
            teleport player to {pos2}
            stop
this won't really solve it I'm afraid because i use world names in the variables, but thank you anyways
 
Status
Not open for further replies.