Solved Teleporting Players to a Location Saved as a Variable

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

Hexivoid

Member
Oct 22, 2017
35
7
8
Skript version and author not applicable.

I'm trying to teleport players in two different arrays to a location saved as a variable, but the players are not being teleported. Can someone please tell me why this portion of my Skript isn't working? Thanks!

(I've already added players to the arrays and checked with a broadcast. Players are being teleported if I type the raw coordinated, but not with the variable!)

code_language.skript:
set {blue.spawn} to "-48, 31, 483"
set {red.spawn} to "52, 35, 483"

teleport {blueteam::*} to location {blue.spawn}
teleport {redteam::*} to location {red.spawn}
 
code_language.skript:
loop {blueteam::*}:       
    teleport loop-value to {blue.spawn}
loop {redteam::*}:       
    teleport loop-value to {red.spawn}
 
code_language.skript:
loop {blueteam::*}:      
    teleport loop-value to {blue.spawn}
loop {redteam::*}:      
    teleport loop-value to {red.spawn}
No errors, but the players still didn't get teleported :emoji_frowning:
[doublepost=1518033571,1518032112][/doublepost]<x>, <y>, <z> is the correct format for locations, right?
 
code_language.skript:
teleport player to location at 0, 0, 0 in world "world"
The coordinates in my Skript will constantly change, meaning I don't want to put in raw coordinates but rather a variable ({blue.spawn}) which is already set to a location.

code_language.skript:
teleport {blueteam::*} to location {blue.spawn}
seems not to be working, even after the variable is set to a location (tested this with a broadcast). Any ideas on how to teleport an array of players to a VARIABLE set to a location and not just COORDINATES? Thanks!
 
The coordinates in my Skript will constantly change, meaning I don't want to put in raw coordinates but rather a variable ({blue.spawn}) which is already set to a location.

code_language.skript:
teleport {blueteam::*} to location {blue.spawn}
seems not to be working, even after the variable is set to a location (tested this with a broadcast). Any ideas on how to teleport an array of players to a VARIABLE set to a location and not just COORDINATES? Thanks!
because youre trying to throw in one text variable for 3 number arguments... you can split your text at ", " and get each coord and parse it as a number or preferably use a list variable and store each coord as a number not text
 
Finally got it! After so long, it feels good to of found an answer! I didn't realize that you could just parse a variable with a location without having to make it a text/string!

code_language.skript:
set {blue.spawn} to location -48, 31, 483 in world "World"   
set {red.spawn} to location 52, 35, 483 in world "World" 

teleport {blueteam::*} to {blue.spawn}             
teleport {redteam::*} to {red.spawn}
[doublepost=1518042755,1518042656][/doublepost]
code_language.skript:
teleport player to location at 0, 0, 0 in world "world"
I took inspiration from this effect and set the variable in this format instead of the teleportation effect. Thank you!
 
Status
Not open for further replies.