Is there a way to change map scroll type?

Hi everyone! I was wondering if there's some type of script to modify the map "Scroll Type" indicated in the editor, (Loop Horizontally, Vertically, or both).
What I'm trying to accomplish is I have a desert map that I want to have start with scroll turned to both, but be able to disable it via switch or in game script or something, to imply that there is no way to find this town without a certain item or something.
Anybody have any ideas?
I think the most Game Devs would use 2 different maps to do something as you described.
The script to change the scroll type would be:
JavaScript:
$dataMap.scrollType = 0; // loop disabled
$dataMap.scrollType = 1; // loop vertical
$dataMap.scrollType = 2; // loop horizontal
$dataMap.scrollType = 3; // loop both
Obviously you don't need all 4 lines. Choose the one you want and only use that one line.

Keep in mind that this will not be saved. If the player is allowed to save, then when they resume the game, the scroll type will be reset to whatever you've defined in the editor.

The easiest fix is to simply not allow the player to save in that map.
Thank you Nolonar that did the trick! Aerosys I did start with two maps but my issue was that the trigger is sort of hidden, so I didnt want to have an obvious transfer between maps. Thanks both of you for the help!!

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-change-map-scroll-type.147505/