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


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help [SOLVED] Levers
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#11
RE: Levers

(10-18-2014, 11:41 AM)Lazzer Wrote:
PHP Code: (Select All)
void Func(string &in asEntityint alState
{
if(
alState == 1)
{
//If ON
}

if(
alState == -1)
{
//If OFF


Those two little bastards allow you to do what happens whether you pull them up or down, I beleive 1 is if you pull lever up, so basically put the stuff you want to happen in the state 1, if neither that helps try putting the stuff to -1 instead of 1.

+rep

(10-18-2014, 07:20 AM)FlawlessHappiness Wrote: Levers work, with the thing called "alState".

This is the callback for a lever, placed in void OnStart() (For beginners)

PHP Code: (Select All)
SetEntityConnectionStateChangeCallback(stringasNamestringasCallback); 

The function will look like this:

PHP Code: (Select All)
void Func(string &in asEntityint alState
{
if(
alState == 1)
{
//If ON
}

if(
alState == -1)
{
//If OFF
}


Simply put in SetLampLit when ON and OFF, and put in false and true, for whatever your liking ^^

+rep

(This post was last modified: 10-19-2014, 09:04 AM by Straxedix.)
10-19-2014, 09:04 AM
Find




Users browsing this thread: 1 Guest(s)