Hello, I've been trying to get a teleport on a keypress to work all day, unfortunately, I can seem to be able to do it.
Basically, all I would like to do it on Key press A, teleport from any location on Map1 to the same location on Map2.
At the moment I have it set to teleport the player after 60f
But really I wanna add it to a key like the Q Key.
I have tried doing
Input.isPressed('L');
and
Input.isPressed('Q');
but it didn't work for some reason.
I followed this little Key Code off a youtube tutorial
I would be grateful of any help.
Cheers
I tried this...
It didnt work 🙁
Basically, all I would like to do it on Key press A, teleport from any location on Map1 to the same location on Map2.
At the moment I have it set to teleport the player after 60f
Code:
// Get the current player's coordinates
var x = $gamePlayer.x;
var y = $gamePlayer.y;
// Defines target map ID
var currentMapId = $gameMap.mapId(1);
var targetMapId = (currentMapId === 1) ? 2 : 1; // Swap between Map001 (ID: 1) and Map002 (ID: 2)
// Transfers the player to the same location on the other map
$gamePlayer.reserveTransfer(targetMapId, x, y, $gamePlayer.direction(), 0);
But really I wanna add it to a key like the Q Key.
I have tried doing
Input.isPressed('L');
and
Input.isPressed('Q');
but it didn't work for some reason.
I followed this little Key Code off a youtube tutorial
I would be grateful of any help.
Cheers
I tried this...
It didnt work 🙁