main local.origin local.angles local.rotatetime local.rotateamount local.clockwise: local.valve = spawn script_model local.valve model "animate/redvalve_nopulse.tik" local.valve.origin = local.origin local.valve.angles = local.angles local.valve notsolid local.valvetrig = spawn trigger_use local.valvetrig.origin = local.valve.origin local.valvetrig setsize ( -20 -20 -20 ) ( 20 20 20 ) local.valvetrig waittill trigger local.valvetrig nottriggerable local.valve.model = animate/redvalve_pulse.tik /////////////////////////////////////////////*** add code here ***////// local.player = parm.other if(local.clockwise == 0) { local.player iprint ("*** Rotating valve counterclockwise. ***") } if(local.clockwise == 1) { local.player iprint ("*** Rotating valve clockwise. ***") } //////////////////////////////////////////////////////////////////////// local.valve time (local.rotatetime) if(local.clockwise == 0) { local.valve rotateZup local.rotateamount } if(local.clockwise == 1) { local.valve rotateZdown local.rotateamount } local.valve playsound valve_switch local.valve waitmove local.valve.model = animate/redvalve_nopulse.tik //wait 1 local.clockwise++ if(local.clockwise >= 2) { local.clockwise = 0 } local.angles = local.valve.angles local.valve remove local.valvetrig remove thread main local.origin local.angles local.rotatetime local.rotateamount local.clockwise end