I need Help With A Big problem with my map. i have places custom levers in the game and they work but when i try to have the lever stick at a place when pulled down they stuff up
so basically their is a fluro ceiling light that is off and when you pull the lever down its supposed to turn on and stick the lever at the down. and then when you pull the lever it unsticks and lets you pull it up so the light turns off. but it doesn't work its just stuck.
anyone know how to make it work?
-----------------------------------------------------------------------------------------------------------
SetEntityConnectionStateChangeCallback("light_switch", "func_switch");
SetEntityPlayerInteractCallback("light_switch", "light", false);
}
void light(string &in asEntity)
{
SetLeverInteractionDisablesStuck("light_switch", true);
}
void func_switch(string &in asEntity, int alState)
{
if (alState == 1)
{
SetLampLit("fluro_1", true, true);
PlaySoundAtEntity("", "click.snt", "Player", 0.0f, false);
SetLeverStuckState("light_switch", 1, false);
}
else
{
if (alState == -1)
SetLampLit("fluro_1", false, true);
PlaySoundAtEntity("", "click.snt", "Player", 0.0f, false);
SetLeverStuckState("light_switch", -1, false);
}
}
But When I Remove The Stuckstate and Player Interaction the script works and they are not stuck. But it only works with lever with one light script in it( so light switches that only start one light work). but others with 2 or more lights strangely do this, when holding the lever down (value 1) the lights stay on. but when i let go (goes to value 0) the lights go out except for the first one on the script code. and when i pull it up (value -1) that one light goes out?