This is one of those multi-step processes that could take hours to properly contruct.
I could start you off a little...
Make an area inside of the cleaner and then add an EntityCollideCallback for the collision of "dirty_object" and "cleaner_area". You would also have to make sure that the "dirty_object" is inside of the "cleaner" when the player closes the "cleaner_door", causing it to lock.
void OnStart()
{
SetLocalVarInt("ObjectIn", 0);
SetLocalVarInt("LevPulled", 0);
AddEntityCollideCallback("dirty_object", "cleaner_area", "Func01", false, 1);
AddEntityCollideCallback("dirty_object", "cleaner_area", "Func02", false, -1);
SetEntityConnectionStateChangeCallback("cleaner_lever", "Func03");
Func04();
}
void Func01(string &in asParent, string &in asChild, int alState)
{
SetLocalVarInt("ObjectIn", 1);
}
void Func02(string &in asParent, string &in asChild, int alState)
{
SetLocalVarInt("ObjectIn", 0);
}
void Func03(string &in asEntity, int alState)
{
if (alState == 1)
{
SetLocalVarInt("LevPulled", 1);
}
else if (alState == 0)
{
SetLocalVarInt("LevPulled", 0);
}
else if (alState == -1)
{
SetLocalVarInt("LevPulled", 0);
}
}
void Func04()
{
if (GetSwingDoorClosed("cleaner_door") == true)
{
if (GetLocalVarInt("ObjectIn") == 1)
{
SetSwingDoorLocked("cleaner_door", true, true);
//Add sound effect here maybe.
if (GetLocalVarInt("LevPulled") == 1)
{
SetLeverStuckState("cleaner_lever", 1, true);
RemoveEntityCollideCallback("dirty_object", "cleaner_area");
AddTimer("", 3, "Func05");
}
}
}
}
void Func05(string &in asTimer)
{
SetSwingDoorLocked("cleaner_door", false, true);
SetEntityActive("dirty_object", false);
SetEntityActive("clean_object", true);
//Insert light, sound, and shake effects here!
}