02-03-2012, 05:20 AM
I Have Done a Key Script for a door but when i pick up the key it just says 'picked up' and in the description it doesn't say anything can someone please tell me what i am doing wrong In Level Editor the Key is called 'hallkey' and the door 'halldoor' and in the entity tab on the key i put customsubitemname to 'hall_key' so could u help?
LANG
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">
You are Inside This strange House that you entered after hearing screams from inside </Entry>
</Entry>
</CATEGORY>
</CATEGORY Name="Inventory">
<Entry Name="ItemName_hall_key">Hall Key</Entry>
<Entry Name="ItemDesc_hall_key"> Key Labeled "Hall Key"</Entry>
</CATEGORY>
</LANGUAGE>
and the script works but here it is for anyone who wants a working one.
{
AddUseItemCallback("", "hallkey", "halldoor", "hallkeydoor", true);
}
void hallkeydoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("halldoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "halldoor", 0, false);
RemoveItem("hallkey");
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
}
LANG
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">
You are Inside This strange House that you entered after hearing screams from inside </Entry>
</Entry>
</CATEGORY>
</CATEGORY Name="Inventory">
<Entry Name="ItemName_hall_key">Hall Key</Entry>
<Entry Name="ItemDesc_hall_key"> Key Labeled "Hall Key"</Entry>
</CATEGORY>
</LANGUAGE>
and the script works but here it is for anyone who wants a working one.
{
AddUseItemCallback("", "hallkey", "halldoor", "hallkeydoor", true);
}
void hallkeydoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("halldoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "halldoor", 0, false);
RemoveItem("hallkey");
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
}