Hi i have a custom map script on my playerworld and am trying to do the warping for it..
it works but i cant figure out how to get the gmap coords from the screencoords of the map..
The map image is 420x420
The gmap is 15 x 15 levels..
Im not good at math so im having some problems here..

mapxy is the coordinates of the map image on the screen..
How is the math done?
to convert the mousescreen coordinates on the map
to gmap coordinates.. so if i click the bottem right corner i will
warp to the bottem right corner, which is 957x957..
this is a part of the script
NPC Code:
if (mousescreenx in | mapxy[0], mapxy[0] + 420 | &&
mousescreeny in | mapxy[1], mapxy[1] + 420 | ) {
this.mapxy = {mousescreenx-mapxy[0]*6.5,mousescreeny-mapxy[1]*6.5}; //here is where i get the gmap coords from the screencoords
//but the math is wrong
if (keydown2(17, true)) {
triggeraction 0, 0, serverside, -Map, warp, #v(this.mapx),#v(this.mapy);
}
}