Hi guys! was wondering if you could help me with some scripting. I have been trying to get a certain locked door to be opened by a key. However, the key doesn't open the door nor will the door stay locked unless I have the box marked "locked", ticked.
Here are my scripts
extra_english.lang file:
<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">
(story description)</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_Test01_Name">Dusty Note</Entry>
<Entry Name="Note_Test01_Text">
(note text).</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_StrangeKey">Strange Key</Entry>
<Entry Name="ItemDesc_StrangeKey">Key for a cellar door.</Entry>
</CATEGORY>
</LANGUAGE>
and here is the HPS:
void onStart()
{
AddUseItemCallback("", "strangekey_1", "cellar_wood01_2", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellar_wood01_2", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_wood01_2", 0, false);
RemoveItem("strangekey_1");
}
void onEnter()
{
}
void OnLeave()
{
}
The key works as intended, when picked up it will say you have picked up strange key and it will show in my inventory along with the description but when used on the door that it is supposed to unlock, it will just not work.
Does anyone know what is wrong with my script
?