The below should work unless there's a typo (it's untested)
In your version you weren't resetting the start points for the sliding yns or xns I think were your variable names - you set them once at the start but you needed to be resetting them in your exit map function; anyway I've set out how I'd do it below including the reset, and hopefully made it shorter/more efficient at the same time. Also I haven't used a v1 RenderScript in a while but I'm pretty sure you can apply them the way I have below, i.e. without making it a string by just passing the function name.
var w = 256;
var h = 176;
var s_h = 240;
var sliding_coords = [0,0];
var frozen_player_info;
/*move to another map
string direction = direction that you left the map in
int layer = new layer
map_object map = new map*/
function ExitMap(direction, layer, map)
{
var Name = GetInputPerson();
var p_coords = [GetPersonX(),GetPersonY()];
LastMap = GetCurrentMap(); //used for Dbug
RingCheck(); //Check to see if blue or red ring
//assuming I have the coordinates right this will grab the player_info
frozen_player_info = GrabImage(0,h,w,s_h-h);
switch(direction)
{
case("north"):
p_coords[1] = 168 - p_coords[1];
sliding_coords = [0, -h];
break;
case("east"):
p_coords[0] = 264 - p_coors[0];
sliding_coords = [w, 0];
break;
case("south"):
p_coords[1] - 184 = p_coords[1];
sliding_coords = [0, h];
break;
case("west"):
p_coords[0] = 264 - p_coords[0];
sliding_coords = [-w, 0];
break;
}
ChangeMap(map);
//I assume Foo sets a layer so I have removed the SetPersonLayer call
Foo(Name, p_coords[0],p_coords[1], GetPersonDirection(name),layer);
FadeOut(200); // My temp solution for the room transitions
SetRenderScript(SlidingMap);
}
//Renderscript for transitions
function SlidingMap()
{
map_image = GrabImage(0, 0, w, h);
Rectangle(0, 0, w, h, Black);
map_image.blit(sliding_coords[0], sliding_coords[1]);
frozen_player_info.blit(0,h);
if(sliding_coords[0] > 0)
{
-- sliding_coords[0];
}
else if (sliding_coords[0] < 0)
{
++ sliding_coords[0];
}
else if (sliding_coords[1] > 0)
{
-- sliding_coords[1];
}
else if (sliding_coords[1] < 0)
{
++ sliding_coords[1];
}
else
{
SetRenderScript(player_info);
}
}