Frictional Games Forum (read-only)

Full Version: Levers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm having trouble with scripting a lever. I'm am trying to make it activate a monster, but when I pull it, it doesn't do anything.

Script:
void OnStart()
{
AddEntityCollideCallback("Player", "trap_1", "Jump1", true, 1);
}
void Jump1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("fail_1", true);
}
You are doing it wrong:

Copy&paste this:

Code:
void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
     if (alState == 1)
     {
     SetEntityActive("fail_1", true);
     }
}
Hope it works!
Do I have to do anything for the lever? I put the script in and nothing happened. I'm guessing it migh thave to do with something in the level editor, but I'm not sure.
Ofc, change the name of the lever to "lever". The problem must be the names.
Thanks, it's working now