void OnStart(){
SetLocalVarInt("Lev", 1);
SetEntityConnectionStateChangeCallback("Lever1", "L1");
SetEntityConnectionStateChangeCallback("Lever2", "L2");
}
void L1(string &in asEntity, int alState)
{
if (GetLeverState("Lever1") == 1)
{
SetEntityActive("ScriptArea_6", true);
SetEntityActive("ScriptArea_4", true);
SetLeverStuckState("Lever1", 1, true);
}
}
void L2(string &in asEntity, int alState)
{
if (GetLeverState("Lever2") == 1)
{
SetSwingDoorLocked("KeyStudyDoor", false, true);
SetEntityActive("PrisonDoor", false);
SetLeverStuckState("Lever2", 1, true);
}
}
This is the code I used in my custom story to get my levers to work. I hope you'll be able to use it. If you want it to show the other message, I think you'll have to add something like this.
void L2(string &in asEntity, int alState)
{
if (GetLeverState("Lever2") == 1)
{
SetSwingDoorLocked("KeyStudyDoor", false, true);
SetEntityActive("PrisonDoor", false);
SetLeverStuckState("Lever2", 1, true);
}
else {
if (GetLeverState("Lever2")==0)
{
SetMessage("Message", "used1", 3);
}
}
}