use on animal if (gotstate("self","tame")==1){
//do something
//another thing
//third thing
}
and thats it.
### corn id=137 name=corn group=stuff icon=gfx\corn.bmp model=gfx\cornraw.b3d scale=2 fx=16 mat=flesh weight=200 info=i cant wate to fry it up healthchange=0 	//Fry! 	on:use { 		if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0){ 			process "frying",500; 			fry; 			alteritem 1,138; 		}else{ 			msg "I need fire to fry this!",3; 			speech "negative"; 		} 	} 	//Eat 	on:eat { 		process "eating",1000; 		eat 0,10,5,0; 	} script=end ### corn(cooked) id=138 name=corn on the cob group=stuff icon=gfx\corncooked.bmp model=gfx\corn.b3d scale=2 fx=16 mat=flesh weight=200 info=i love corn on the cob healthchange=0 	//Eat 	on:eat { 		process "eating",1000; 		eat 5,10,5,3; 	}
### Aggressive Native id=49 ### Horse id=50
on:newPath { 		$rnd=random(1,9); 		if ($rnd==1 || $rnd==2){ 			ai_mode "self", "mover"; 		} 		if ($rnd==3 || $rnd==4){ 			ai_mode "self", "movel"; 		} 		if ($rnd>4){ 			ai_mode "self", "move"; 		} 		if(inrange(self ,430)){ 			msg "Mam Mam!"; 			$x=getx("self"); 			$z=getz("self"); 			$newId=create("unit",50,$x,$z); 			$sh = health(self); 			$h = $sh -100; 			health "unit", $newId, $h; 			free "self"; 		} 		if($h < 100){ 			health "self", 1; 		} 	}
on:intro { 	// Intro Music 	music "music_castaway.mp3",0.4; 	// strong blur 	blur 0.85; 	 	// setup intro sequence 	seqstart 1,1; 	seqtimemode 1000,1; 	cammode 0,1,"info",10; // Camera Points at Ship 	 	// ------------------------------------------------------------------------------ intro start 	// scene 1 	setcam 0,2; 	seqfade 0,1500,0,0,0,2; 	seqmsg 6,"Ryan Dean Games",5; 	seqfade 8,10000,0,0,0,0; 	seqmsg 9,"Presents...",5; 	// scene 2 	seqevent 9,"scene2a"; 	setcam 9,11; 	seqevent 12,"scene2b"; 	seqmsg 14,"A second adventure",5; 	seqmsg 20,"A second chance to survive",5; 	seqfade 24,26000,0,0,0,0; 	// scene 3 	seqevent 25,"scene3a"; 	setcam 25,5; 	movecam 25,30000,6; 	seqevent 30,"scene3b"; 	seqmsgclear 24; 	seqmsg 26,"A second Cast Away",5; 	seqfade 34,36000,0,0,0,0; 	// scene 4 	seqevent 35,"scene4a"; 	setcam 35,7; 	seqmsgclear 34; 	seqmsg 37,"Only nature will decide when it's time",5; 	movecam 35,45000,8; 	seqevent 37,"scene4b"; 	seqevent 38,"scene4c"; 	seqevent 39,"scene4c"; 	seqevent 40,"scene4b"; 	seqevent 42,"scene4c"; 	seqevent 43,"scene4c"; 	seqmsg 43,"Cast",5; 	seqevent 46,"scene4d"; 	seqmsg 49,"Away",5; 	// scene 5 	movecam 53,45000,12; 	seqmsgclear 54; 	seqmsg 55,"Again",5; 	seqmsg 56,"Cast Away Again Coming Soon",5; 	seqfade 57,53000,0,0,0,1; 	seqmsgclear 58; 	 	// ------------------------------------------------------------------------------ intro end 	// end intro / loadmap 	seqevent 59,"loadnextmap"; } on:skipsequence { 	event "loadnextmap","global"; } // scene 1 // stuff is done in intro event // scene 2 on:scene2a { 	setpos "info",10,$x,$y,$z; 	freeunitpath 101; 	unitpath 101,3; } on:scene2b { 	thunder; } // scene 3 on:scene3a { 	setpos "info",10,$x,$y,$z; 	freeunitpath 101; 	unitpath 101,3; } on:scene3b { 	thunder; 	flash 230,230,255; 	addstate "info",10,"electroshock"; 	addstate "info",10,"smoke"; 	$x2=getx("info",10); 	$y2=gety("info",10); 	$z2=getz("info",10); 	explosion $x2,($y2+100),$z2,150; } // scene 4 on:scene4a { 	setpos "info",10,$x,$y,$z; 	freeunitpath 101; } on:scene4b { 	explosion $x,($y+80),$z,300; } on:scene4c { 	explosion $x+random(-50,50),($y+random(50,80)),$z+random(-50,50),100; } on:scene4d { 	flash 255,180,50,0.05,2.0; 	play "explode.wav"; 	free "info",10; 	fademusic 8000; } // load next map on:loadnextmap { 	loadmap "maps\adven2\firstile.s2"; }
on:drop 	{ 	$mieso=currentid(); 	$miesox=getx("self"); 	$miesoz=getz("self"); 	if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0) 		{ 		timer 0,3000,1,"pieczenie"; 		freetimers "self"; 		} 	} on:pieczenie 	{ 	create "item",10,($miesox),($miesoz); 	fry; 	free "item",$mieso; 	freevar $mieso, $miesox, $miesoz; 	freetimers "self"; 	}
on:drop { 		local $myid,$myx,$myz; 		$myid=currentid(); 		$myx=getx("self"); 		$myz=getz("self"); 		if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0){ 			timer "self",5000,1,"frying"; 		} 	} 	on:frying { 		local $myid,$myx,$myz; 		create "item",10,($myx),($myz); 		free "item",$myid; 		freetimers "self"; 	}
script=begin
on:drop 	{ timer 0,15600,1,"fryvar"; 	if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0) 		{ 		skipevent; 		if($fry==0) 			{ 			freestored "unit",1,70,1; 			$id=create("item",70); 			timer "item",$id,15500,1,"fry"; 			play "fry.mp3"; 			$fry=1; 			} 		else 			{ 			msg "I must wait until the first thing is finished",3; 			speech "negative"; 			} 		} 	} on:fry 	{ 	$id=currentid(); 	if ((count_inrange("state",5,50,"item",$id)+count_inrange("state",4,50,"item",$id))>0) 		{ 		local $x; 		local $z; 		local $id; 		$x=getx("self"); 		$z=getz("self"); 		$id=create("item",71,$x,$z); 		$fry=0; 		free "self"; 		timer "item","$id",8000,1,"burned"; 		} 	} on:collect 	{ 	freetimers "self"; 	$fry=0; 	}