| larslu   Junior Member
 
 Posts: 30
 Threads: 15
 Joined: Mar 2011
 Reputation: 
0
 | 
			| Door open automatically script 
 
				How can I make a script so when I walk into a area, a door opens automatically?
			 
 THE CAKE IS A LIE!!! |  | 
	| 04-13-2011, 07:00 PM |  | 
	
		| palistov   Posting Freak
 
 Posts: 1,208
 Threads: 67
 Joined: Mar 2011
 Reputation: 
57
 | 
			| RE: Door open automatically script 
 
				First, add AddEntityCollideCallback("Player", "trigger_area", "OpenDoor", true, 1);
 your function to call will be
 
 void OpenDoor(string &in asParent, string &in asChild, int alState)
 {
 AddPropImpulse("Door", X, Y, Z, "World"); //red is x axis, blue is z axis, green is y axis.
 }
 
 Change your X Y and Z values until they apply an appropriate force to open the door.
 
 |  | 
	| 04-13-2011, 07:17 PM |  | 
	
		| Josh707   Junior Member
 
 Posts: 27
 Threads: 5
 Joined: Apr 2011
 Reputation: 
0
 | 
			| RE: Door open automatically script 
 
				SetSwingDoorClosed("DoorName", T/F, T/F);
 
 First T/F= true or false, true = closed, false = open
 
 Second T/F = true or false still, true = use effects false = not use effects... I have no idea what the difference is though.
 
				
(This post was last modified: 04-16-2011, 06:29 AM by Josh707.)
 |  | 
	| 04-16-2011, 06:28 AM |  |