Need to see entire script and every error that is being generated.
Please do not use red text, that is an eyesore to read.
if(asItem == "stone_hammer_chipper")
SetPropHealth("padlock_rusty_1", 0.0f);
SetEntityActive("padlock_broken_1", true);
SetEntityActive("padlock_rusty_1", false);
RemoveItem("stone_hammer_chipper");
PlaySoundAtEntity("", "impact_metal_high.snt", "prison_section_1", 0, false);
GiveSanityBoost();
CompleteQuest("padlockquest", "PadLockQuest");
SetEntityPlayerInteractCallback("prison_section_1", "", false);
PlayMusic("12_puzzle_cavein.ogg", false, 1.0, 0, 1, true);
AddTimer("", 30.0, "ResetMusic"); //Reset the music
I see an issue right here. When using the if statement, if you don't add brackets, it only reads the next line as part of the if statement. So you need to this entire block with
if(asItem == "stone_hammer_chipper")
{
SetPropHealth("padlock_rusty_1", 0.0f);
SetEntityActive("padlock_broken_1", true);
SetEntityActive("padlock_rusty_1", false);
RemoveItem("stone_hammer_chipper");
PlaySoundAtEntity("", "impact_metal_high.snt", "prison_section_1", 0, false);
GiveSanityBoost();
CompleteQuest("padlockquest", "PadLockQuest");
SetEntityPlayerInteractCallback("prison_section_1", "", false);
PlayMusic("12_puzzle_cavein.ogg", false, 1.0, 0, 1, true);
AddTimer("", 30.0, "ResetMusic"); //Reset the music
}
Although I would prefer the much easier to read:
if(asItem != "stone_hammer_chipper") return; //we didn't use the stone hammer/chipper, so do nothing.
SetPropHealth("padlock_rusty_1", 0.0f);
SetEntityActive("padlock_broken_1", true);
SetEntityActive("padlock_rusty_1", false);
RemoveItem("stone_hammer_chipper");
PlaySoundAtEntity("", "impact_metal_high.snt", "prison_section_1", 0, false);
GiveSanityBoost();
CompleteQuest("padlockquest", "PadLockQuest");
SetEntityPlayerInteractCallback("prison_section_1", "", false);
PlayMusic("12_puzzle_cavein.ogg", false, 1.0, 0, 1, true);
AddTimer("", 30.0, "ResetMusic"); //Reset the music
void UsedKeyOnDoor2(string &in item, string &in entity) should also be:
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)