(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
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 anyway