Well what you said to do ended up killing the lamp. :-\
PHP Code:
function onTimeout(){
DoLamp();
setTimer(0.5);
}
function onCreated(){
setimgpart("lampanimation.gif",0,0,19,35);
dontblock();
}
function onPlayerEnters(){
onCreated();
}
function DoLamp(){
showimg(1,"light2.png",x-3,y-3);
changeimgcolors(1,1,0.4,0,0.4);
changeimgzoom(1,random(.8,1.4));
changeimgvis(1,3);
}