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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lever Puzzle Scripting
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Lever Puzzle Scripting

Just whipped this out. It's not tested yet so I *think* you'll find some troubles. You have to change some names too.
Spoiler below!

PHP Code: (Select All)
//Your levers must be Lever_1, Lever_2, and so on until Lever_4.
void OnStart()
{
    
SetEntityConnectionStateChangeCallback("Lever_*""Scream");
    
SetLocalVarInt("Levers"0);
}

void Scream(string &in asEntitystring &in type)
{
    if(
alState = -1)
    {
    
PlaySoundAtEntity("Screams""SoundFile.snt""Player"0.1ffalse);
    
AddLocalVarInt("Levers"1);
    
CheckLevers();
    }
}

void CheckLevers()
{
    if(
GetLocalVarInt("Levers") == 4)
    {
    
SetSwingDoorLocked("DoorName"falsetrue);
    }



"Veni, vidi, vici."
"I came, I saw, I conquered."
10-29-2013, 08:04 AM
Find


Messages In This Thread
Lever Puzzle Scripting - by 3gamers - 10-28-2013, 07:47 PM
RE: Lever Puzzle Scripting - by PutraenusAlivius - 10-29-2013, 08:04 AM
RE: Lever Puzzle Scripting - by 3gamers - 10-29-2013, 03:15 PM
RE: Lever Puzzle Scripting - by PutraenusAlivius - 10-29-2013, 03:17 PM



Users browsing this thread: 1 Guest(s)