I don't fully understand but what I think you want is this.
you want to have two doors one you open when you use a key on it and one to open when you pick up the lantern.
If I'm wrong my bad. but to do what I think you want to do you can use this:
FOR THE LEVEL DOOR
void OnStart()
{
AddUseItemCallback("", "
Name_of_Key", "
Name_of_Leveldoor", "
UsedKeyOnDoor", true);
}
void
UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("
Name_of_Leveldoor", false);
PlaySoundAtEntity("", "unlock_door", "
Name_of_Leveldoor", 0, false);
RemoveItem("
Name_of_Key");
}
||||||
Also make sure you have the leveldoorlocked!!!||||||
And use this for the lantern:
void OnStart()
{
SetEntityPlayerInteractCallback("Name_Of_Lantern", "
OnLanternPickUp", true);
}
void
OnLanternPickUp(string &in item)
{
SetLevelDoorLocked("
Name_of_Leveldoor", false);
}
But if you want to make the door open/unlocked but you can't open it you could use:
SetEntityInteractionDisabled(string& asName, bool abDisabled);
on the door. so you can't click on it I hope this helped