////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "chamberkey", "chamberdoor", "FUNCTION1", true);
AddUseItemCallback("", "cellarkey", "cellerdoor", "FUNCTION2", true);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
AddEntityCollideCallback("Player" , "doorbreak" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player", "doorslamtrigger1", "Func01", true, 1);
}
void FUNCTION1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("chamberdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "chamberdoor", 0, false);
RemoveItem("chamberkey");
SetSwingDoorClosed("doorslam", true, true);
SetSwingDoorClosed("doorslam2", true, true);
}
void FUNCTION2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellerdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "cellerdoor", 0, false);
RemoveItem("cellarkey");
}
void OnEnter()
{
}
void OnLeave
{
}
Right, so this code should work for you. I'll let you know what you missed
1) Your syntax was incorrect for your functions. For AddUseItemCallback, you need to end your callback function with (string &in asItem, string &in asEntity). The wikipage shows the correct syntax for callback functions, as well as timers and the like. They're bolded underneath the function.
2) If you want two separate doors to unlock, you need to name the unlock functions accordingly. I changed it up to Function1 and Function2. Of course, you could also use a subroutine, but I left it simple.
3) You forgot to put closing quotation marks around cellarkey in Function2, as well as spelling it differently.
4) All .hps files need to have a OnEnter and OnLeave function. You can leave these empty if you wish, as they only perform functions when the player enters or leaves the map