main local.origin local.angles local.turnbackoff: local.switch = spawn script_model local.switch model "animate/alarmswitch.tik" local.switch.origin = local.origin local.switch.angles = local.angles local.switch notsolid local.switchtrig = spawn trigger_use local.switchtrig.origin = local.switch.origin local.switchtrig setsize ( -20 -20 -20 ) ( 20 20 20 ) local.switchtrig waittill trigger local.switchtrig nottriggerable local.switch anim turnon local.switch playsound alarm_switch /////////////////////////////////////////////*** add code here ***////// local.player = parm.other if(local.turnbackoff != 1) { local.player iprint ("*** Turning on alarm switch. ***") } if(local.turnbackoff == 1) { local.player iprint ("*** Toggling alarm switch. ***") } wait 1 //////////////////////////////////////////////////////////////////////// if(local.turnbackoff == 1) { local.switch anim turnoff wait 1 } if(local.turnbackoff != 1) { local.switchtrig triggerable local.switchtrig waittill trigger local.switch anim turnoff local.switch playsound alarm_switch /////////////////////////////////////////////*** add code here ***////// local.player = parm.other local.player iprint ("*** Turning off alarm switch. ***") wait 1 //////////////////////////////////////////////////////////////////////// } local.switch remove local.switchtrig remove thread main local.origin local.angles local.turnbackoff end