Alright, so the lever_machine_lever ones run the block once interacted with. If all those levers are in state -1 when one of them is, it makes them all stuck and plays the sounds. The issue here is that elevator_lever_2 has no way of being in state -1 before this happens, therefore the last part of the block can never be called; thus the Activate block never runs either.
What you can do is to use a variable instead. Add another lever callback to the elevator_lever_2 and have it check for this variable. You trigger it in the "stuck" script.
void LeverBox(string &in asEntity, int LeverState)
{
if(GetLeverState("lever_machine_lever_1") == -1
&& GetLeverState("lever_machine_lever_2") == -1
&& GetLeverState("lever_machine_lever_3") == -1
&& GetLeverState("lever_machine_lever_4") == -1
&& GetLeverState("lever_machine_lever_5") == -1
&& GetLeverState("lever_machine_lever_6") == -1)
{
PlaySoundAtEntity("", "sob01.snt", "Player", 0, false);
SetEntityActive("elevator_lever_1", false);
SetEntityActive("elevator_lever_2", true);
for(int i = 1; i <= 6; i++)
SetEntityInteractionDisabled("lever_machine_lever_"+i, true);
SetLocalVarInt("Lever", 1);//Added this line which is used when interacting with the elevator_lever_2
}
}
void ElevatorLever(string &in asEntity, int LeverState)
{
if(GetLocalVarInt("Lever") != 0) {
if(GetLeverState(asEntity) == -1) Activate();
}
}
To use this, you must also remove the parameters of Activate, since it uses none.