04-03-2013, 02:24 PM
I have added something to my map, but when I use the key, it just can't unlock here is the script:
Code:
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "doorkey", "startingDoor", "UsedKeyOnDoor", true);
}
void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Starting_Door", false, true);
PlaySoundAtEntity("", "unlock_door", "startingDoor", 0, false);
RemoveItem("doorkey");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}