How can I teleport people when they get to a specific Y-coordinate?

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

    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.

DitDit

Member
Jul 22, 2020
1
0
1
This is the code I have so far:

every 1 tick:
loop all players:
if loop-player's y-coordinate is 320:
set {moonreturn.%loop-player's uuid%} to location of loop-player
execute console command "/execute in minecraft:the_end run tp {%loop-player%} 0 64 0"​

The looping works, I see that with debug mode, but the variable and command doesn't.
I'm returning to Skript after an almost 12-month abscence so sorry if the issue is obvious
 
This is the code I have so far:

every 1 tick:
loop all players:
if loop-player's y-coordinate is 320:
set {moonreturn.%loop-player's uuid%} to location of loop-player
execute console command "/execute in minecraft:the_end run tp {%loop-player%} 0 64 0"​

The looping works, I see that with debug mode, but the variable and command doesn't.
I'm returning to Skript after an almost 12-month abscence so sorry if the issue is obvious
1. Please do not loop all players every tick, that is very bad
2. Use a while loop rather than a periodical event
3. Use list variables rather than nest variables
3. Use the teleport effect and the location function rather than a console command
If you have any questions ask
 
Status
Not open for further replies.