Not sure if I set up correctly, but I didn't change anything just tryed to sort it out.
Hopefully you can help him now falmez3
void OnStart()
{
}
void Levers(string &in asEntity, int alState)
{
/*Set values depending on up/down postion or 0 for middle */ if(alState == -1)
if(asEntity == "L1") SetLocalVarInt("up_"+asEntity, 3);
else if(asEntity == "L2") SetLocalVarInt("up_"+asEntity, 3);
else if(asEntity == "L3") SetLocalVarInt("up_"+asEntity, 5);
else if(asEntity == "L4") SetLocalVarInt("up_"+asEntity, 1);
else if(asEntity == "L5") SetLocalVarInt("up_"+asEntity, 2);
else if(asEntity == "L6") SetLocalVarInt("up_"+asEntity, 4);
CheckValue(asEntity);
}
else if(alState == 1)
{
if(asEntity == "L1") SetLocalVarInt("down_"+asEntity, 1);
else if(asEntity == "L2") SetLocalVarInt("down_"+asEntity, 5);
else if(asEntity == "L3") SetLocalVarInt("down_"+asEntity, 6);
else if(asEntity == "L4") SetLocalVarInt("down_"+asEntity, 5);
else if(asEntity == "L5") SetLocalVarInt("down_"+asEntity, 2);
else if(asEntity == "L6") SetLocalVarInt("down_"+asEntity, 2);
CheckValue(asEntity);
}
else if(alState == 0)
{
SetLocalVarInt("up_"+asEntity, 0);
SetLocalVarInt("down_"+asEntity, 0);
}
if(GetLocalVarInt("up_value") == 11 && GetLocalVarInt("down_value") == 8)
{
SetEntityActive("ShardDoor", false);
GiveSanityBoost();
PlayMusic("02_puzzle.ogg", false, 0.7f, 0, 10, false);
PlaySoundAtEntity("door_safety_open", "door_safety_open.snt", "Player", 0.0f, false);
}
void CheckValue(string sEntity)
{
PlaySoundAtEntity("s"+sEntity, "lever_mech_min_max", sEntity, 0.0f, false);
SetLocalVarInt("up_value", 0);
SetLocalVarInt("down_value", 0);
for(int i=1;i<=6;i++)
{
AddLocalVarInt("up_value", GetLocalVarInt("up_L"+i));
AddLocalVarInt("down_value", GetLocalVarInt("down_L"+i)); }
}
void OnEnter()
{
PlayMusic("18_amb.ogg", true, 1, 2.0f, 0, false);
}
void OnLeave()
{
StopMusic(2,0);
}