Frictional Games Forum (read-only)

Full Version: How do i make a lever that removes something?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do i make a lever that removes something?
Like there's a lever hidden somewhere, and its supposed to delete something...
Whats the code for that?
Help please!
SetEntityConnectionStateChangeCallback
as well as
SetEntityActive

Will do so.

Example
PHP Code:
void OnStart()
{
    
SetEntityConnectionStateChangeCallback("lever_1""LeverPulled");
}
void LeverPulled(string &in asEntityint alState)
{
    if(
alState == 1)
    {
        
SetEntityActive("entity_1"false);
        
SetLeverStuckState("lever_1"1true);
    }