if (room == room_field1_ch1) global.flag[500] += 1; if (room == room_field2_ch1) { if (global.flag[50] != 0) global.flag[501] = global.flag[50]; }