Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Door open automatically script
larslu Offline
Junior Member

Posts: 30
Threads: 15
Joined: Mar 2011
Reputation: 0
#1
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
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
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
Find
Josh707 Offline
Junior Member

Posts: 27
Threads: 5
Joined: Apr 2011
Reputation: 0
#3
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
Find




Users browsing this thread: 1 Guest(s)