Hey all.
I'm trying to make a amnesia custom map (started yesterday) and for some reason my key won't work on the door.
What's wrong?
This is the script:
////////////////////////////
// Run when entering map
void OnStart()
{
AddEntityCollideCallback("Player", "scriptmusic","scriptmusic", true, 0);
AddEntityCollideCallback("Player", "CloseDoor1", "CollideCloseDoor1", true, 1);
AddUseItemCallback("", "key1", "Door_1", "UsedKeyOnDoor", true);
}
void scriptmusic(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
PlayMusic("19_event_brute.ogg", true, 1.00, 0, 5, true);
}
if (alState == -1)
{
StopMusic(10, 5);
}
}
void CollideCloseDoor1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("mansion_2", true, true);
}
void UsedKeyOnDoor(string &in item, string &in door)
{
SetSwingDoorLocked("Door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_1", 0, false);
RemoveItem("key1");
}
and this is the .lang file:
sorry for my english ( secondary language )