I've browsed through the various tutorials and searched through these forums for a solution to my Key>Door related issues and failed to find anything that helps, so here goes. It's probably some stupid error but, I need a push in the right direction.
void UseKey("Hotel Room Key, "Hotel Room Door"){
// Set the entity(desk or door) to unlocked
SetSwingDoorLocked("Hotel Room Door", false, true);
// Remove the item used from the inventory
RemoveItem(Hotel Room Key);
PlaySoundAtEntity("", "unlock_door.snt", "Hotel Room Door",0.0f, true);
AddDebugMessage("The Door has successfully opened. Congratulations!", false);
}
////////////////////////////
// Run first time starting map
void OnStart()
{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100.0f);
for(int i = 0;i < 10;i++)
{
GiveItemFromFile("tinderbox", "tinderbox.ent");
}
}
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
}
Any help would be appreciated.