MV How can I replace TileID with Tile Ladder Flag?

Below is some code im working with.

"
DW_Command_Window.prototype.onStairs = function() {
var eventId = $gameMap.eventIdXy($gamePlayer.x, $gamePlayer.y);
if (eventId !== 0) {
var event = $gameMap.event(eventId);

if(event.page().image.tileId === 16 ||
event.page().image.tileId === 8 ||
event.page().image.tileId === 7) {
this.hideWindow();
AudioManager.playSe({ name: 'Stairs-Up', volume: 90, pitch: 100, pan: 0});
return event.start();
}
}

$gameMessage.add("`'There are no stairs here.'");
}

In this code, I want to replace the


"
event.page().image.tileId === 16 ||
event.page().image.tileId === 8 ||
event.page().image.tileId === 7
"


"


with the ladder Tile flag, so I can Go up and down stairs like a ladder.



But all I see in the Content about JS Library flags is

"
flags Array

The tileset flags."

Maybe thats not descript enough for me.
Can you use

Code:
$gameMap.isLadder(x, y)

?
No, that doesn't seem to work. Basically I open a menu and select 'Enter'
To Open doors, entrances.. not just walk on it.

But for the stairs to work i must be on it and select 'Enter'

I am confused as to how I could make it work. I checked the library for something like 'Current Tile' but can't find it....

Any other suggestions?
If I understand it right, you want to know if the player is on the 1st floor, 2nd floor, 3rd floor, etc, right?

You could use regions (tab R in your tileset) to mark floors, like this:
1686604364907.png


Then try this when you want to check what floor you're on:
1686604253105.png



That should do the trick. Hope that helped.
Solved it. I ended up Treating stairs like a regular door.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-replace-tileid-with-tile-ladder-flag.158281/