Set a global variable to the layout number when a player goes to it...
System.LayoutName gets the current layout's name.
Develop games in your browser. Powerful, performant & highly capable.
My example was assuming you were viewing a different layout than your player was currently on.. as in a "store" or "menu" layout.