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
(Script)Lever Opens a Door
SilentHideButFine Offline
Member

Posts: 156
Threads: 38
Joined: May 2012
Reputation: 6
#8
RE: (Script)Lever Opens a Door

(06-12-2012, 08:46 AM)TheNoAuthor12 Wrote: Hi, guys. I'm making a custom story and there's a lever that opens and closes a door. The name of the door is "wooden_slide_door_1". And I have no idea how to script it. Can someone tell me how to do it ?
Take the script he gave you its good and easy to understand if not follow this (this tut is with buttons)

http://wiki.frictionalgames.com/hpl2/tut...pen_a_door

Smile


oid OnStart()
{
SetLocalVarInt("Var1", 0);
SetEntityPlayerInteractCallback("button1", "func1", true);
SetEntityPlayerInteractCallback("button2", "func2", true);
SetEntityPlayerInteractCallback("button3", "func3", true);
SetEntityPlayerInteractCallback("button4", "func4", true);
}

void func1(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func2(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func3(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func4(string &in asEntity)
{
AddLocalVarInt("Var1", 1);
func5();
}

void func5()
{
if(GetLocalVarInt("Var1") == 4)
{
/////add what ever you want to happen after you press all 4 buttons here.
SetSwingDoorLocked("door1", false, false);
PlaySoundAtEntity("", "unlock_door.snt", "door1", 0.5f, false);
}
}
I think you can change the Entity to lever not sure but anywaySmile

[url= http://www.moddb.com/mods/jessehmusic [/url] ,HOSPITAL OF HORROR MOD
06-13-2012, 10:21 AM
Find


Messages In This Thread
(Script)Lever Opens a Door - by No Author - 06-12-2012, 08:46 AM
RE: (Script)Lever Opens a Door - by Putkimato - 06-12-2012, 12:12 PM
RE: (Script)Lever Opens a Door - by No Author - 06-12-2012, 12:54 PM
RE: (Script)Lever Opens a Door - by Putkimato - 06-12-2012, 03:23 PM
RE: (Script)Lever Opens a Door - by No Author - 06-13-2012, 06:40 AM
RE: (Script)Lever Opens a Door - by Putkimato - 06-13-2012, 09:48 AM
RE: (Script)Lever Opens a Door - by No Author - 06-13-2012, 09:57 AM
RE: (Script)Lever Opens a Door - by SilentHideButFine - 06-13-2012, 10:21 AM
RE: (Script)Lever Opens a Door - by No Author - 06-13-2012, 10:27 AM
RE: (Script)Lever Opens a Door - by Theforgot3n1 - 06-13-2012, 12:56 PM
RE: (Script)Lever Opens a Door - by No Author - 06-14-2012, 08:31 AM
RE: (Script)Lever Opens a Door - by Dutton - 06-14-2012, 09:30 AM
RE: (Script)Lever Opens a Door - by No Author - 06-14-2012, 10:02 AM
RE: (Script)Lever Opens a Door - by No Author - 06-15-2012, 07:21 AM



Users browsing this thread: 1 Guest(s)