(08-05-2012, 08:01 PM)SuperSoldier333 Wrote: What is a level door? If it's a door to end a level, no I don't have one. i just have a room with two doors, one locked and the other that leads to a room with full of closet and grunt.
try this code:
////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "keydoor", "mansion_1", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, false);
RemoveItem("keydoor");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
Hope this helps