How to change the teleporters to only teleport to each other?

How to change the teleporters to only teleport to each other? - Cheerful modern male and female in comfortable casual clothes unpacking car trunk in green garden of new house while moving in together

In Level 17, how can I set the teleports to only teleport to other safe zones? Since the teleporters change every time you set the map, this is the only thing I can think of.

enter image description here



Best Answer

Just like @agent86, I decided to hijack the loop. My solution is slightly shorter and links all 3 teleporter near the player to the ones near the exit.

var player = map.getPlayer();
var entry = [], exit = [];

for (i = 0; i < teleportersAndTraps.length; i++) {
    var t = teleportersAndTraps[i];
    if (t.getType() == 'teleporter') {
        if (Math.abs(t.getX() - player.getX()) <= 2 &&
            Math.abs(t.getY() - player.getY()) <= 2)
            entry.push(t);
        if (Math.abs(t.getX() - (map.getWidth() - 10)) <= 2 &&
            Math.abs(t.getY() - (map.getHeight() - 5)) <= 2)
            exit.push(t);
    }
}

for (i = 0; i < 3; i++)
    entry[i].setTarget(exit[i]);

break;

Basically, I'm looking for any teleporter that has a x- or y-distance of 2 or less to the player or the exit.




Pictures about "How to change the teleporters to only teleport to each other?"

How to change the teleporters to only teleport to each other? - Happy couple in casual clothes moving personal items in carton boxes from car trunk to new house
How to change the teleporters to only teleport to each other? - Couple talking while moving in new apartment
How to change the teleporters to only teleport to each other? - Couple in yard unloading car while moving house



How do you make a part teleport to another game in Roblox?

The default state of the Teleporter is set up to immediately enable creators to set up a two-teleporter system. Placing two teleporters and changing no settings will automatically set up the ability to walk through one teleporter and end up at the other. The default values are bold.

How do fortnite teleporters work?

Open the Minecraft app and load the world that you'd like to play in. Access the pause menu by tapping the top-right of the display \u2013 the icon isn't always displayed, but it's there. Tap Settings and toggle the Cheats switch on to enable the use of teleportation.



How To Make A Teleporter In Roblox




More answers regarding how to change the teleporters to only teleport to each other?

Answer 2

What i did is link each teleporter in the list to the teleporter that comes after it in the list, and because of that all the teleporters form one big loop. all i did was just always enter the teleporter i just went through, and after a few teleports i got to the exit.

Answer 3

In my case these solutions did not convince me. I actually just didn't like the idea of linking directly to the exit, what I did was looking for each teleporter for one a step closer to the exit, that way, no matter the path you choose, you will always end up where you want (the exit) by using the teleports and without any risk of falling into the traps (unless I guess if you jump into the last row or column of teleports, I tried and it actually crashes if you the link is empty [edit: actually not, it does not crash, I realized it just takes a little bit of time to load it and there are still traps in the last rows/columns, it might not be the most efficient timewise]... but hey, it works! hahaha).

Here is my code if you want to look at it: https://gist.github.com/Untrusted-Game/5f78e8633962adc9d34e28ecebac1e4a

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Ketut Subiyanto, Ketut Subiyanto, Ketut Subiyanto, Ketut Subiyanto