I'm having some issues getting a door to unlock. I have the item "Hollow needle" in my level, and I'm trying to get it to unlock a "Prison door". I have named the needle to "Sharp_needle" and the door to "prison_door_01".
For the needle, I have set up the name and description. My hps. file looks like below:
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "Sharp_needle", "prison_door_01", "FUNCTION", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_door_01", false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem("Key01");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
I don't understand why it won't work. Could anyone shed some light on this please? Thanks