Frictional Games Forum (read-only)

Full Version: Another Lever help thread[SOLVED]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I'm not very experienced in scripting but I want it so that when I pull the a lever down it moves a shelf or deactivate the current shelf and reactivate the moved shelf. It's probably easy enough but I just can't get it to work.

void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever_1", "SecretShelf");
}

void SecretShelf(string &in EntityName, int alState)
{
if (alState == -1)
{
SetEntityActive("Shelf_1", false);
SetEntityActive("Shelf_2", true);
}
}

Help appreciated Smile
Try this:

Code:
void OnStart()
{
     SetEntityConnectionStateChangeCallback("Lever_1", "SecretShelf");
}
void SecretShelf(string &in asEntity, int alState)
{
     if (alState == 1)
     {
          SetEntityActive("Shelf_1", false);
          SetEntityActive("Shelf_2", true);
          return;
     }
}
}
Nope it doesnt work :-\ If Anyone have a functional Lever - door function please post it so I can see what you guys did to get it to work Smile
Oh, I know what's wrong...

The SetEntityActive command doesn't always work for everything.

Try replacing it with a closet or something.
You know I just did, I tried it with a closet and it worked, Thank you! Big Grin
Would you happen to know how I get like a message up "It's locked" when a player click on the door?
You're welcome. I had the same exact problem until I replaced it with a closet... XD