-- Script by Bod -- Runs animation once and turns off collision if entity health gets below 20 -- Adjust the entities strength to determine how many shots or hits are required to open the door local open = {} function ifhitanimate1_init(e) open[e] = 0 end function ifhitanimate1_main(e) PlayerDist = GetPlayerDistance(e) if PlayerDist < 150 and g_Entity[e] ['health'] > 20 then Prompt("Locked but the door looks old, maybe I can shoot the lock out.") end if g_Entity[e]['health'] < 20 then if open[e] == 0 then -- gate is closed StartTimer(e) if g_Entity[e]['animating'] == 0 then SetAnimation(0) PlayAnimation(e) open[e] = 1 g_Entity[e]['animating'] = 1 PlaySound(e,0) CollisionOff(e) end end end end