here my code sir..
Code:
function change_elem()
{
	if(key_1==1)
	{
		my.elem_stat = fire;
		if(my.elem_stat == fire)
		{
		im_on_fire(); //function of fire particle
		}
	}
	if(key_2 ==1)
	{
		my.elem_stat = ice;
		if(my.elem_stat == ice)
		{
		im_on_ice();  //function of ice particle
		}
	}
	else
	set(my,INVISIBLE | PASSABLE);
}