I would do like this:
if (f5) { // f5 = new room, you can put any flag here
v100 = x;
}
if (v100 == 1) {
// do your stuff, for when timer ends (alarm), end of countdown... you know
}
v100--;
x is not the number of seconds, it's the number of logic cycles...
I use v100==1 and NOT v100==0 because if you would do that, everything in that block will be executed every cycle, until v100 is given another value...
The program will go like this:
* Enter room
* first cycle:
set v100 the value x
v100 = x-1
* second cycle
v100 = x-2
* third cycle
v100 = x-3
:
:
:
* x-1 th cycle
v100 = 1
special stuff will be done
* x th cycle
v100 = 0
* x +1 th cycle
v100 = 0
and so on...