Frictional Games Forum (read-only)

Full Version: Need help coding for key to work on door
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
okay so the lang file is good, but the test.hps file must be wrong. This is what i have so far


//===========================================
// Starter's Script File!
//===========================================

//===========================================
// This runs when the map first starts
void OnStart()
{
AddUseItemCallback("", "door_key", "hallway_door", "UsedKeyOnDoor", true);
}

void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("hallway_door", false, true);
PlaySoundAtEntity("", "unlock_door", "hallway_door", 0, false);
RemoveItem("door_key");
}
//===========================================
// This runs when the player enters the map
void OnEnter()
{
}

//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}





if anyone could help me get my key to work on the door id appreciate it Smile thanks!
When you use the key on the door, you're calling UsedKeyOnDoor, when you named the function to unlock the door MyFunc.
what do you mean?
void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("hallway_door", false, true);
PlaySoundAtEntity("", "unlock_door", "hallway_door", 0, false);
RemoveItem("door_key");
}
Replace the bolded text with UsedKeyOnDoor
THANK YOU!!!!!