01-22-2013, 10:15 AM
I'm trying to make a script where the player can lock and unlock the same door. But when I lock it, it doesn't lock the door. Here's my script :
When I give the study key using the "GiveItem" Script, the picture on the inventory is like this :
And I want to make a script where the player can interact with a candle to turn it off if it's lit. I've searched on the engine scripts and I didn't found anything about turning off candles.
PHP Code:
void OnStart()
{
AddUseItemCallback("", "key_study", "mansion_1", "UseKeyOnDoor01", true);
}
void UseKeyOnDoor01(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0.0f, true);
AddUseItemCallback("", "key_study", "mansion_1", "LockDoor01", true);
}
void LockDoor01(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "lock_door.snt", "mansion_1", 0, true);
AddUseItemCallback("", "key_study", "mansion_1", "UseKeyOnDoor01", true);
}
And I want to make a script where the player can interact with a candle to turn it off if it's lit. I've searched on the engine scripts and I didn't found anything about turning off candles.