srobb 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 24 
	Threads: 4 
	Joined: Sep 2012
	
 Reputation: 
0
		
	 | 
	
		
			
Music OnStart? 
			 
			
				How do I get music to play as soon as the player enters the map? It's just ambient music, nothing special.
			 
			
			
			
		 |  
	 
 | 
 
	| 10-01-2012, 09:34 AM  | 
	
		
	 | 
 
 
	
		
		TeamSD 
 
 
		
			Member 
			
			
			
 
			
	Posts: 51 
	Threads: 3 
	Joined: Apr 2012
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Music OnStart? 
			 
			
				 (10-01-2012, 09:34 AM)srobb Wrote:  How do I get music to play as soon as the player enters the map? It's just ambient music, nothing special. void OnEnter() 
{ 
PlayMusic("track_you_want_to_play.ogg", true, 2, 2, 0, true); 
}
			  
			
			
 
			
		 |  
	 
 | 
 
	| 10-01-2012, 09:47 AM  | 
	
		
	 | 
 
 
	
		
		srobb 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 24 
	Threads: 4 
	Joined: Sep 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Music OnStart? 
			 
			
				main (8, 1) : ERR : Unexpected token '{' 
Line 8 is just '{'. 
 
 
void OnEnter() 
{ 
PlayMusic("29_amb.ogg", true, 2, 2, 0, true); 
}
			 
			
			
			
		 |  
	 
 | 
 
	| 10-01-2012, 10:11 AM  | 
	
		
	 | 
 
 
	
		
		TeamSD 
 
 
		
			Member 
			
			
			
 
			
	Posts: 51 
	Threads: 3 
	Joined: Apr 2012
	
 Reputation: 
2
		
	 | 
	
		
			
RE: Music OnStart? 
			 
			
				 (10-01-2012, 10:11 AM)srobb Wrote:  main (8, 1) : ERR : Unexpected token '{' 
Line 8 is just '{'. 
 
 
void OnEnter() 
{ 
PlayMusic("29_amb.ogg", true, 2, 2, 0, true); 
} Could you show me your whole script.
			  
			
			
 
			
		 |  
	 
 | 
 
	| 10-01-2012, 10:40 AM  | 
	
		
	 | 
 
 
	
		
		FlawlessHappiness 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 3,980 
	Threads: 145 
	Joined: Mar 2012
	
 Reputation: 
171
		
	 | 
	
		
			
RE: Music OnStart? 
			 
			
				void OnStart() 
{ 
 
} 
 
void OnEnter() 
{ 
PlayMusic("29_amb.ogg", true, 2, 2, 0, true); 
} 
 
void OnLeave() 
{ 
 
 
} 
 
This should make no problem at all... It must've been something your script
			 
			
			
 
Trying is the first step to success. 
			
		 |  
	 
 | 
 
	| 10-01-2012, 10:41 AM  | 
	
		
	 | 
 
 
	
		
		srobb 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 24 
	Threads: 4 
	Joined: Sep 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Music OnStart? 
			 
			
				////Onstartmap 
 
void OnStart() 
{ 
 
} 
	 
void OnEnter() 
{ 
PlayMusic("29_amb.ogg", true, 2, 2, 0, true); 
} 
 
Still won't work. It says "main (13, 1) : ERR: Unexpected token '{'. 
Line 13 is just a {. I don't get what I've done wrong? Everything was working fine until I put the PlayMusic script in.
			 
			
			
			
		 |  
	 
 | 
 
	| 10-01-2012, 11:31 AM  | 
	
		
	 | 
 
 
	
		
		i3670 
 
 
		
			Posting Freak 
			
			
			
 
			
	Posts: 1,308 
	Threads: 74 
	Joined: Oct 2011
	
 Reputation: 
36
		
	 | 
	
		
			
RE: Music OnStart? 
			 
			
				Can you post the whole script, please?
			 
			
			
 
			
		 |  
	 
 | 
 
	| 10-01-2012, 11:48 AM  | 
	
		
	 | 
 
 
	
		
		srobb 
 
 
		
			Junior Member 
			
			
			
 
			
	Posts: 24 
	Threads: 4 
	Joined: Sep 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: Music OnStart? 
			 
			
				Nevermind, I got it working. 
Thanks   
			 
			
			
			
		 |  
	 
 | 
 
	| 10-01-2012, 11:51 AM  | 
	
		
	 | 
 
 
	 
 |