Frictional Games Forum (read-only)
[SCRIPT] destorying a padlock with a hammer - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] destorying a padlock with a hammer (/thread-14401.html)



destorying a padlock with a hammer - zombiehacker595 - 04-01-2012

what would i have to do to fix this when ever i click the hammer on the padlock just says cant use item this way
void OnStart()
{
AddUseItemCallback("", "stone_hammer_1", "padlock_1", "unlock_prison_section_1", true);
}
void unlock_prison_section_1(string &in asItem, string &in asEntity)
{
SetPropHealth("padlock_1", 0.0f);
}
void BreakPadlock (string &in asItem, string &in asEntity)
{
SetEntityActive("padlock_broken_1",true);
SetEntityActive("padlock_1",false);
RemoveItem("stone_hammer_1");
}




RE: destorying a padlock with a hammer - flamez3 - 04-01-2012

void OnStart()
{
AddUseItemCallback("", "stone_hammer_1", "padlock_1", "unlock_prison_section_1", true);
}
void unlock_prison_section_1(string &in asItem, string &in asEntity)
{
SetPropHealth("padlock_1", 0.0f);
SetEntityActive("padlock_broken_1",true);
RemoveItem("stone_hammer_1");
}
Try this



RE: destorying a padlock with a hammer - zombiehacker595 - 04-01-2012

ok that activated the broken padlock and it fell off but didnt destory the original padlock
void OnStart()
{
AddUseItemCallback("OpenDoor", "key_study_1", "level_wood_1", "UnlockLevelDoor", true);
AddUseItemCallback("", "stone_hammer_1", "padlock_1", "unlock_prison_section_1", true);
}
void unlock_prison_section_1(string &in asItem, string &in asEntity)
{
SetPropHealth("padlock_1", 0.0f);
SetEntityActive("padlock_broken_1",true);
RemoveItem("stone_hammer_1");
SetEntityActive("padlock_1", false);
}

void OnEnter()
{
}
i just had to add set entity active padlock_1 false and it worked thanks



RE: destorying a padlock with a hammer - flamez3 - 04-01-2012

np mate