Thank you Crimson Wizard, it worked!
Finally can I go forward on this work. I have never see a code like this before but it worked.
But I made a little adjustment on this code. It now works perfectly.
Thanks again all!
Case closed! And feel free if anyone here want that free code that is if you want that code for your own game creations.
Code: ags

But I made a little adjustment on this code. It now works perfectly.
Thanks again all!
Case closed! And feel free if anyone here want that free code that is if you want that code for your own game creations.
// room script file
int Secret = 0;
#define POSITION_START_MOVE 0
#define POSITION_CHANGE_GRAPHIC 110
#define POSITION_END_MOVE 310
function room_RepExec()
{
// If thing is not moving OR if it just went all the way to the right -
if (!oThings.Moving || oThings.X >= POSITION_END_MOVE) {
// Move thing back
oThings.X = POSITION_START_MOVE;
// Switch to next object's x-ray graphic (set to your sprites accordingly)
switch (oThings.Graphic) {
case 1425: oThings.Graphic = 1425; break;
case 5903: oThings.Graphic = 1427; break;
case 5892: oThings.Graphic = 1428; break;
case 5893: oThings.Graphic = 1429; break;
case 5894: oThings.Graphic = 1430; break;
case 5895: oThings.Graphic = 1431; break;
//... etc
}
// Begin moving through x-ray window
oThings.Move(POSITION_END_MOVE, 157, -3, eNoBlock, eAnywhere);
}
// If thing was moving and just passed x-ray window
else if (oThings.Moving && oThings.X > POSITION_CHANGE_GRAPHIC) {
// Change from x-ray to normal graphic (set to your sprites accordingly)
switch (oThings.Graphic) {
case 1425: oThings.Graphic = 5903; break;
case 1427: oThings.Graphic = 5892; break;
case 1428: oThings.Graphic = 5893; break;
case 1429: oThings.Graphic = 5894; break;
case 1430: oThings.Graphic = 5895; break;
//... etc