jakeni96 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 3 
	Threads: 1 
	Joined: Feb 2012
	
 Reputation: 
0
		
	 | 
	
		
			
Script help: Monster spawns when picked up a key 
			 
			
				So, I'm making my own custom story right now, and im trying to make a monster spawn exactly when you pick up a key. I've tried to make it work a couple of times, but still no results. 
 
If anyone knows how to fix this, tell me.
			 
			
			
			
		 |  
	 
 | 
	| 06-30-2012, 07:09 PM  | 
	
		
	 | 
	
		
		ApeCake 
 
 
		
			Member 
			
			
			
 
			
	Posts: 116 
	Threads: 20 
	Joined: Jun 2012
	
 Reputation: 
4
		
	 | 
	
		
			
RE: Script help: Monster spawns when picked up a key 
			 
			
				There are multiple ways to do this, I prefer this one. 
 
 
void OnStart() 
{ 
SetEntityCallbackFunc("NAMEofKEY", "OnPickup"); 
} 
void OnPickup(string &in asEntity, string &in type) 
{ 
if(asEntity == "NAMEofKEY") 
	{ 
 SetEntityActive("NAMEofYOURMONSTER", true); 
	} 
}  
 
 
Just make sure to UNCHECK "active" under the monstername in the level editor.
			 
			
			
			
		 |  
	 
 | 
	| 06-30-2012, 07:36 PM  | 
	
		
	 | 
	
		
		Cruzore 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 301 
	Threads: 2 
	Joined: Jun 2012
	
 Reputation: 
37
		
	 | 
	
		
			
RE: Script help: Monster spawns when picked up a key 
			 
			
				we could fix it better when you post your try, so we can just correct it and you'll see what you did wrong.
			 
			
			
 
Think, before you speak Google, before you post 
			
		 |  
	 
 | 
	| 06-30-2012, 07:36 PM  | 
	
		
	 | 
	
		
		jakeni96 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 3 
	Threads: 1 
	Joined: Feb 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Script help: Monster spawns when picked up a key 
			 
			
				I got it working now BTW, i just did the string wrong.
			 
			
			
			
		 |  
	 
 | 
	| 07-01-2012, 11:32 AM  | 
	
		
	 |