ok so you got that a little mixed up, like
@jazzzar says you need to do some good practice, but i will repost the code and put comments in so you can understand it a bit better
so first up you need this in a room before you goto your first game room, so you would have a empty room and make an object call it oInitial and place it in that empty room, this should be the very first room in the resource tree, as that is where game maker will start from, in that oInitial create event do this
oInitial create event
Code:
global.playerX = 100;// this will give the player it first starting x location when you create the player in the first game room
global.playerY = 100;// this will give the player it first starting y location when you create the player in the first game room
room_goto_next();// this will just send your game to the next room in the resource tree
object player create event
Code:
x = global.playerX;// this will make the player start at that x location we set just before
y = global.playerY;// this will make the player start at that y location we set just before
step event object player
Code:
if (place_meeting (x, y+1, obj_barrier)) and (room == rm_1)
{
global.playerX = x;// this will save its x location just before you jump rooms, so that each time you create the player again that code in the create event will read this
global.playerY = y;// this will save its y location just before you jump rooms, so that each time you create the player again that code in the create event will read this
room_goto (rm_2);// if your going to be going back and forth from rooms then you will have to have lots of if this room is room what ever then goto room what ever
}
so you will never have to change the x and y locations as it will always update it when your jumping rooms