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
On and off light.
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#7
RE: On and off light.

Create a lever, doesn't matter which one.
Set the configuration of the lever like shown in the image.
[Image: Qw2NX.jpg]


Put this into your script:
void LightSwitch(string &in asEntity, int alState)
{
    if(alState == 1){
    
        for(int i=1;i<=20;i++)  //Change the 20 to any number you want, e.g. 10, this will cause only the first 10 to be lit/unlit
        {
        SetLampLit("l"+i, false, true);
        }

    }
    else if(alState == -1){
        for(int i=1;i<=20;i++)  //Change the 20 to any number you want, e.g. 10, this will cause only the first 10 to be lit/unlit
        {
        SetLampLit("l"+i, true, true);
        }
    }
}

By moving the lever up the lamps get lit and by moving down they get unlit.
Works infinite times.

Have fun! Wink

[Image: 18694.png]
(This post was last modified: 07-16-2012, 01:22 AM by Ongka.)
07-16-2012, 01:15 AM
Find


Messages In This Thread
On and off light. - by gabiaef - 07-15-2012, 11:04 PM
RE: On and off light. - by Your Computer - 07-15-2012, 11:22 PM
RE: On and off light. - by Ongka - 07-15-2012, 11:23 PM
RE: On and off light. - by gabiaef - 07-15-2012, 11:30 PM
RE: On and off light. - by Ongka - 07-15-2012, 11:46 PM
RE: On and off light. - by gabiaef - 07-15-2012, 11:59 PM
RE: On and off light. - by Ongka - 07-16-2012, 01:15 AM
RE: On and off light. - by gabiaef - 07-16-2012, 01:45 AM
RE: On and off light. - by Ongka - 07-16-2012, 01:51 AM



Users browsing this thread: 1 Guest(s)