The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Help With Levers and Stuckstate
heyitsrobert97 Offline
Member

Posts: 68
Threads: 29
Joined: Jan 2012
Reputation: 0
#1
Help With Levers and Stuckstate

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 Undecided 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?

This Darn House! , Four Doors, Youtube
(This post was last modified: 05-31-2012, 12:44 PM by heyitsrobert97.)
05-31-2012, 12:34 PM
Find


Messages In This Thread
Help With Levers and Stuckstate - by heyitsrobert97 - 05-31-2012, 12:34 PM
RE: Help With Levers and Stuckstate - by Putmalk - 05-31-2012, 03:12 PM



Users browsing this thread: 1 Guest(s)