| 
		
	
		| Storfigge   Member
 
 Posts: 101
 Threads: 31
 Joined: Sep 2012
 Reputation: 
0
 | 
			| Why doesn't this work? 
 
				Hey
 I have a script box named "Sleep". Why doesn't the script work??
 
 {
 AddEntityCollideCallback("Player", "Sleep", "activate_sleep", true, 1);
 }
 
 void activate_sleep(string &in asParent, string &in asChild, int alState)
 {
 FadeOut(5);
 AddTimer("T1", 10f, "Timer_1");
 }
 
 void Timer_1(string &in asTimer)
 {
 FadeIn(5);
 }
 
 Just get error... I've used pretty much the exact same script before without any problem.
 
 
				
(This post was last modified: 04-16-2015, 01:58 PM by Storfigge.)
 |  |  
	| 04-16-2015, 01:57 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: Why doesn't this work? 
 
				You need to tell us the error.
 The first thing that comes to mind is that you're missing "void OnStart()" in your first function.
 
 void OnStart()
 {
 AddEntityCollideCallback("Player", "Sleep", "activate_sleep", true, 1);
 }
 
 Trying is the first step to success. |  |  
	| 04-16-2015, 02:12 PM |  |  
	
		| Storfigge   Member
 
 Posts: 101
 Threads: 31
 Joined: Sep 2012
 Reputation: 
0
 | 
			| RE: Why doesn't this work? 
 
				 (04-16-2015, 02:12 PM)FlawlessHappiness Wrote:  You need to tell us the error.
 The first thing that comes to mind is that you're missing "void OnStart()" in your first function.
 
 void OnStart()
 {
 AddEntityCollideCallback("Player", "Sleep", "activate_sleep", true, 1);
 }
 
Oops i apologize i did actually add void OnStart() just missed to put that in the first question. The error is
: INFO : Compiling void activate_sleep(string&in, string&in, int) 
 
: ERR : Expected ')' or ','  This one is for the AddTimer
			 
 |  |  
	| 04-16-2015, 04:39 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: Why doesn't this work? 
 
				Try removing the f at 10.
			 
 Trying is the first step to success. |  |  
	| 04-16-2015, 04:42 PM |  |  
	
		| Storfigge   Member
 
 Posts: 101
 Threads: 31
 Joined: Sep 2012
 Reputation: 
0
 | 
			| RE: Why doesn't this work? 
 
				 (04-16-2015, 04:42 PM)FlawlessHappiness Wrote:  Try removing the f at 10. The error disappeared but now the fadeout don't work :/ This is so weird all of these scripts worked before I've used them in my past mod...
			 
 
				
(This post was last modified: 04-16-2015, 04:47 PM by Storfigge.)
 |  |  
	| 04-16-2015, 04:47 PM |  |  
	
		| Amnesiaplayer   Senior Member
 
 Posts: 539
 Threads: 105
 Joined: Jun 2014
 Reputation: 
0
 | 
			| RE: Why doesn't this work? 
 
				 (04-16-2015, 04:47 PM)Storfigge Wrote:   (04-16-2015, 04:42 PM)FlawlessHappiness Wrote:  Try removing the f at 10.The error disappeared but now the fadeout don't work :/ This is so weird all of these scripts worked before I've used them in my past mod... 
you know that 10 seconds is long, right?! like you dont't just wait 5 seconds and stop... right?!
			 |  |  
	| 04-16-2015, 04:52 PM |  |  
	
		| Storfigge   Member
 
 Posts: 101
 Threads: 31
 Joined: Sep 2012
 Reputation: 
0
 | 
			| RE: Why doesn't this work? 
 
				 (04-16-2015, 04:52 PM)Amnesiaplayer Wrote:   (04-16-2015, 04:47 PM)Storfigge Wrote:   (04-16-2015, 04:42 PM)FlawlessHappiness Wrote:  Try removing the f at 10.The error disappeared but now the fadeout don't work :/ This is so weird all of these scripts worked before I've used them in my past mod... you know that 10 seconds is long, right?! like you dont't just wait 5 seconds and stop... right?!
 
What?? The fadeout is instant and is suppose to take 5 sec to finish, then the timer will activate the fadein after 10 sec. And since when was 10 seconds a long time?
			 
 |  |  
	| 04-16-2015, 04:57 PM |  |  
	
		| Romulator   Not Tech Support ;-)
 
 Posts: 3,628
 Threads: 63
 Joined: Jan 2013
 Reputation: 
195
 | 
			| RE: Why doesn't this work? 
 
				Is your ScriptArea or whatever your player is colliding with in your map named 'Sleep'?
			 
 Discord: Romulator#0001
![[Image: 3f6f01a904.png]](https://puu.sh/zOxJg/3f6f01a904.png) |  |  
	| 04-17-2015, 01:07 AM |  |  
	
		| Storfigge   Member
 
 Posts: 101
 Threads: 31
 Joined: Sep 2012
 Reputation: 
0
 | 
			| RE: Why doesn't this work? 
 
				 (04-17-2015, 01:07 AM)(拉赫兰) Romulator Wrote:  Is your ScriptArea or whatever your player is colliding with in your map named 'Sleep'? 
Strange the script works now I guess all I had to do was restart everything :O
			 
 
				
(This post was last modified: 04-17-2015, 01:31 PM by Storfigge.)
 |  |  
	| 04-17-2015, 01:30 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: Why doesn't this work? 
 
				 (04-17-2015, 01:30 PM)Storfigge Wrote:   (04-17-2015, 01:07 AM)(拉赫兰) Romulator Wrote:  Is your ScriptArea or whatever your player is colliding with in your map named 'Sleep'? Strange the script works now I guess all I had to do was restart everything :O
 
Yes. You have to restart to make the script restart.
			 
 Trying is the first step to success. |  |  
	| 04-17-2015, 01:34 PM |  |  |