Mateh 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 10 
	Threads: 3 
	Joined: Oct 2010
	
 Reputation: 
0
		
	 | 
	
		
			
Adding 2nd script 
			 
			
				I tried different ways to add two script but it is wrong for example, "Excepted or Unecepted, 2 hours to tire and nothing. Can someone enlighten me. 
Quote://////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
   AddUseItemCallback("", "key_tower_1", "prison_section_1", "UsedKeyOnDoor", true); 
} 
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
 
{	 
  SetSwingDoorLocked("prison_section_1", false, true);   
  PlaySoundAtEntity("", "unlockdoor", "prison_section_1", 0, false); 
  RemoveItem("key_tower_1"); 
} 
 
// 
 
{					 
  AddEntityCollideCallback("Player", "ScriptArea_2", "CollideScript_2", true, 1); 
}	 
 
void  CollideScript_2(string &in asParent, string &in asChild, int alState); 
 
{ 
  SetSwingDoorClosed("cellar_wood01_1", true, false); 
}	 
  
 
  
 
  
  
 /////////////////////////// 
// Run when entering map 
void OnEnter() 
 
{ 
 
} 
 
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{ 
	 
} 
			 
			
			
			
		 |  
	 
 | 
 
	| 10-20-2010, 04:37 PM  | 
	
		
	 | 
 
 
	
		
		Frontcannon 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 538 
	Threads: 10 
	Joined: Jul 2010
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Adding 2nd script 
			 
			
				{                     
  AddEntityCollideCallback("Player", "ScriptArea_2", "CollideScript_2", true, 1); 
}
 
ಠ_ಠ 
 
Please read  this before you do any more scripting. Then feel free to ask questions.
			  
			
			
 
 
╔═════════════════╗ 
☺ Smoke weed everyday ☺ 
╚═════════════════╝ 
 
			
		 |  
	 
 | 
 
	| 10-20-2010, 04:59 PM  | 
	
		
	 | 
 
 
	
		
		LoneWolf 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 308 
	Threads: 43 
	Joined: Sep 2010
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Adding 2nd script 
			 
			
				AddEntityCollideCallback("Player", "ScriptArea_2", "CollideScript_2", true, 1); 
 
should be in the void on start part... 
 
EG. 
 
//////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
AddUseItemCallback("", "key_tower_1", "prison_section_1", "UsedKeyOnDoor", true); 
AddEntityCollideCallback("Player", "ScriptArea_2", "CollideScript_2", true, 1); 
}
			 
			
			
			
		 |  
	 
 | 
 
	| 10-20-2010, 05:04 PM  | 
	
		
	 | 
 
 
	
		
		Mateh 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 10 
	Threads: 3 
	Joined: Oct 2010
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Adding 2nd script 
			 
			
				Is not working 
 
 
 
//////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
   AddUseItemCallback("", "key_tower_1", "prison_section_1", "UsedKeyOnDoor", true); 
   AddEntityCollideCallback("Player", "ScriptArea_2", "CollideScript_2", true, 1); 
} 
 
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
 
{	 
  SetSwingDoorLocked("prison_section_1", false, true);   
  PlaySoundAtEntity("", "unlockdoor", "prison_section_1", 0, false); 
  RemoveItem("key_tower_1"); 
} 
 
// 
 
					 
void  CollideScript_2(string &in asParent, string &in asChild, int alState); 
 
{ 
  SetSwingDoorClosed("cellar_wood01_1", true, false); 
}	 
  
 
  
 
  
  
 /////////////////////////// 
// Run when entering map 
void OnEnter() 
 
{ 
 
} 
 
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{ 
	 
} 
 
and also not working 
 
 
 
//////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
   AddUseItemCallback("", "key_tower_1", "prison_section_1", "UsedKeyOnDoor", true); 
   AddEntityCollideCallback("Player", "ScriptArea_2", "CollideScript_2", true, 1); 
} 
 
 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
void  CollideScript_2(string &in asParent, string &in asChild, int alState); 
 
{	 
  SetSwingDoorLocked("prison_section_1", false, true);   
  SetSwingDoorClosed("cellar_wood01_1", true, false); 
  PlaySoundAtEntity("", "unlockdoor", "prison_section_1", 0, false); 
  RemoveItem("key_tower_1"); 
} 
 
 
 
					 
 
 
 
 
  
 
  
  
 /////////////////////////// 
// Run when entering map 
void OnEnter() 
 
{ 
 
} 
 
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{ 
	 
}
			 
			
			
			
		 |  
	 
 | 
 
	| 10-20-2010, 05:34 PM  | 
	
		
	 | 
 
 
	
		
		LoneWolf 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 308 
	Threads: 43 
	Joined: Sep 2010
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Adding 2nd script 
			 
			
				//////////////////////////// 
// Run first time starting map 
void OnStart() 
{ 
AddUseItemCallback("", "key_tower_1", "prison_section_1", "UsedKeyOnDoor", true); 
AddEntityCollideCallback("Player", "ScriptArea_2", "CollideScript_2", true, 1); 
} 
void UsedKeyOnDoor(string &in asItem, string &in asEntity) 
{  
SetSwingDoorLocked("prison_section_1", false, true);  
PlaySoundAtEntity("", "unlockdoor", "prison_section_1", 0, false); 
RemoveItem("key_tower_1"); 
} 
void CollideScript_2(string &in asParent, string &in asChild, int alState); 
{ 
SetSwingDoorClosed("cellar_wood01_1", true, false); 
}  
/////////////////////////// 
// Run when entering map 
void OnEnter() 
{ 
} 
//////////////////////////// 
// Run when leaving map 
void OnLeave() 
{ 
} 
 
 
 
 
 
 
 
 
 
Change your script to this, you have many unnecessary spaces, you dont need spaces like what you have done. This should work unless you've not named somethign right. 
 
Eh, also have you named your key and door properly? 
 
EG. in your level editor select your door your using and press the entity tab, you should see  CallBackFunc, under it write the doors name, eg. door1. 
 
For the key the name of key should be under  CustomSubItemTypeName. 
 
If this all fails then i have no idea whats wrong
			 
			
			
			
		 |  
	 
 | 
 
	| 10-20-2010, 05:49 PM  | 
	
		
	 | 
 
 
	 
 |