08-21-2011, 01:12 AM
Keys are the one of the most easy things I know how to script, but why the hell is it saying "Cannot Use Item This Way!" Here is my code, and I hawk-eyed it, saw nothing wrong, and someone else looked at it and ALSO saw nothing wrong! The key/door names are all correct, and the key has a subitemtext.
Code:
AddUseItemCallback("", "key_firstfloor", "firstfloordoor", "UsedKeyOnDoor", true);
---------------------------
void UsedKeyOnDoor(string &in asParent , string &in asChild , int alState)
{
SetLevelDoorLocked("firstfloordoor", false);
SetLevelDoorLockedSound("firstfloordoor", "door_level_wood_locked.snt");
RemoveItem("key_firstfloor");
}