can anyone help with saba kan's dungeon gen?

Ok so I make this short dungeon game 12 floors and a boss at the end. i saw saba kan's script for random dungeon gen so i thought "hey thats like pokemon mystery dungeon!" so i set up the maps as shown in the post after first testing it in another longer project im working on. after sorting out the various mistakes i made i do a run through and get an error 

Script 'Minimap' line 335: NoMethodError occurred.​
undefined method `x' for nil:NilClass​
 ​
no other scripts are added. and i dont know what to do please help
https://drive.google.com/file/d/0B4VCXKsTrfekcndSLXAyR1ZRX3M/view?usp=sharing

Here is a link to the game data if it will help solve the problem.
bump...

Original thread: https://forums.rpgmakerweb.com/threads/can-anyone-help-with-saba-kans-dungeon-gen.37672/