Ok, so my latest version of the trigger is an action that changes the switch from off to on everytime the player kits "enter". Unfortunately, I get just a black screen now. Here's the code:

Code:
ENTITY* t_trigger;

var trig_percentage;

action trigger_switch()
{
	t_trigger = me; //this is a pointer defining the entity listed at the top

	while(1)
	if (key_enter)
	{

		if(trig_percentage = 1)
		{
			trig_percentage %= 100;
			trig_percentage += 2*time_step;
			ent_animate(t_trigger, "on", trig_percentage, ANM_SKIP);
			trig_percentage = 0;
		}
		else
		trig_percentage %= 100;
		trig_percentage += 2*time_step;
		ent_animate(t_trigger, "off", trig_percentage, ANM_SKIP);
		trig_percentage = 1;
		
		wait(1);

	}


}