Frictional Games Forum (read-only)

Full Version: Problem with Door Code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everybody. I am currently making my first map and I for the life of me CAN NOT GET THE KEY TO WORK!!! Angry when I pick it up it says "Picked up" and the key has no description. and will not work on the door. I have named the key in the right place and everything. Here is my Coding and lang files.


void OnStart()
{
AddUseItemCallback("", "key_1", "castle_silent.ent", "unlockdoor", true);
}


void unlockdoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(key_1);
}

void OnLeave()
{

}


and my extra_English.lang



</LANGUAGE>


<CATEGORY Name ="Inventory">
<Entry Name="ItemName_Key_1">Key</Entry>
<Entry Name="ItemDesc_Key_1">"lawls"</Entry>
</CATEGORY>

</LANGUAGE>



If anyone could help me I would be forever in debt XD Big Grin
I think you have the wrong Syntax.
here, use this


void OnStart()
{
AddUseItemCallback
("", "key_1", "your_door", "unlockdoor", "true for autodestroy");
}


asName - internal name
asItem - internal name of the item
asEntity - entity to be able to use the item on
asFunction - function to call
abAutoDestroy - determines whether the item is destroyed when used
Did it work?