Frictional Games Forum (read-only)

Full Version: [Help Needed] Key found in one level used on Door in another.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!

As the title says, i wonder how to make a key that you find in one level open a door in another level. In what Hpl File should it be in? The one with the door? The one with the key? Or maybe both?

Thanks a lot!
As long as you don't try to duplicate key/door names, it should work fine with a regular script when you transfer it from level to level. Just be sure to put the callback/function in the same level as the door
The key you find in the level 1 is named "Key". The door in the 2 level is named "Door".

Code for level 2:

Code:
void OnStart()
{
AddUseItemCallback("", "Key", "Door", "Opendadoor", true);
}

void Opendadoor (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door", false, true);
}