how to teleport from one layer to another?

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
llVIU
Inserter
Inserter
Posts: 48
Joined: Sat Jul 06, 2019 9:19 pm
Contact:

how to teleport from one layer to another?

Post by llVIU »

Hello, in map editor you have multiple layers, nauvis is the normal layer. Some scenarios have other layers, used as undergorund. I got a map where you spawn normally on the custom layer, I made a multiplayer game and my friends are stuck on the nauvis layer. I know the command /c game.player.teleport({X, Y}) but I don't know how to move someone to my layer... anyone knows?

I also don't understand why placing the player spawn object doesn't do anything. I try to set it, but it does nothing, the player always spawns in the same exact layer and location.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: how to teleport from one layer to another?

Post by eradicator »

Code: Select all

/c
local p = game.player
game.players['yourfriendsname].teleport({p.position.x+2,p.position.y},p.surface)
If you spawned the player port in the map editor maybe it has the wrong force ("team")?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Technical Help”