local kills_required = {} killed = {} door_number = {} local open = {} local temp = 0 function door_kill_requirement_init_name(e,name) weapon_name[e] = name kills_required[e] = 0 killed[e] = 0 open[e] = 0 end function door_kill_requirement_main(e) if kills_required[e] == 0 then for a = 1,9999 do if g_Entity[a] ~= nil and a ~= e then if weapon_name[a] ~= nil then if weapon_name[a] == weapon_name[e] then SetActivated(e,1) door_number[a] = e kills_required[e] = kills_required[e] + 1 end end end end else if killed[e] >= kills_required[e] then if GetPlayerDistance(e) < 150 then if g_Entity[e]['activated'] == 1 then if g_Entity[e]['animating'] == 0 then StartTimer(e) SetAnimation(0) PlayAnimation(e) g_Entity[e]['animating'] = 1 SetActivated(e,2) ActivateIfUsed(e) PlaySound(e,0) end else -- door collision off after 1 second if GetTimer(e) > 1000 then CollisionOff(e) end end else if GetPlayerDistance(e) > 160 then -- door is open if g_Entity[e]['activated'] == 2 then if g_Entity[e]['animating'] == 0 then StartTimer(e) SetAnimation(1) PlayAnimation(e) g_Entity[e]['animating'] = 1 SetActivated(e,1) PlaySound(e,1) end else if GetTimer(e) > 550 then CollisionOn(e) end end end end else if GetPlayerDistance(e) < 150 then Prompt("You still need to kill "..kills_required[e]-killed[e].." enemies before you may proceed") end end end end