void OnStart()
{
AddUseItemCallback("", "HammerChipper", "RustyLock", "DoorUnlockAnim", true);
}
void DoorUnlockAnim(string &in asItem, string &in asEntity)
{
SetPropHealth("RustyLock", 0.0f); //RustyLock is the Lock.
SetPropHealth("DoorName", 0.0f); //Door is hit with damage too as you explained it. Change doorname to what ever your door's name is.
SetSwingDoorLocked("DoorName", false, false); //Change doorname to whatever your door's name is.
PlaySoundAtEntity("", "LOCKBREAK.snt", "Player", 0.0f, false); //Change LOCKBREAK.snt to the sound of a lock broken with the extension .snt.
SetEntityActive("Hammer", true); //Hammer.
SetEntityActive("Chipper", true); //Chipper.
AddTimer("", 1.4f, "HammerChipperMove");
}
void HammerChipperMove(string &in asTimer)
{
SetMoveObjectState("Hammer", 0.40);
SetMoveObjectState("Chipper", 0.40);
AddTimer("", 1.1f, "HammerChipperMove2");
}
void HammerChipperMove2(string &in asTimer)
{
SetMoveObjectState("Hammer", 0.1f);
SetMoveObjectState("Chipper", 0.1f);
AddTimer("", 0.5f, "TimerLoop");
}
void TimerLoop(string &in asTimer)
{
AddTimer("", 0.2f, "HammerChipperMove");
AddTimer("", 0.3f, "HammerChipperMove2");
AddTimer("", 2.4f, "HammerChipperEnd"); //Change 2.4f to how long you want the smashing process to endure.
}
void HammerChipperEnd(string &in asTimer)
{
SetEntityActive("Hammer", false);
SetEntityActive("Chipper", false);
RemoveTimer("HammerChipperMove");
RemoveTimer("HammerChipperMove2");
}