The problem is not saving the image I am doing that just fine.
If you need to see the exact code...
NPC Code:
GuiMiniMapDraw.saveimage("minimaps/minimap_"@player.level.substring(0,player.level.po s("."))@".png");
the previously shown was just to give an example of what I was doing...