local pressed = 0 open = {} door_number = {} local door = 0 function remote_door_trigger_init(e) door = door + 1 door_number[e] = door open[door] = 0 end function remote_door_trigger_main(e) if GetPlayerDistance(e) <= 150 then if g_Entity[doorE[door_number[e]]] ~= nil then if open[door_number[e]] == 0 then Prompt("Press E to open the door") if g_KeyPressE == 1 and pressed == 0 then if g_Entity[doorE[door_number[e]]]['animating'] == 0 then open[door_number[e]] = 1 SetAnimation(0) PlayAnimation(e); PlayAnimation(doorE[door_number[e]]) CollisionOff(e) CollisionOff(doorE[door_number[e]]) g_Entity[doorE[door_number[e]]]['animating'] = 1 end pressed = 1 end else Prompt("Press E to close the door") if g_KeyPressE == 1 and pressed == 0 then if g_Entity[doorE[door_number[e]]]['animating'] == 0 then open[door_number[e]] = 0 SetAnimation(1) PlayAnimation(e); PlayAnimation(doorE[door_number[e]]) CollisionOn(e) CollisionOn(doorE[door_number[e]]) g_Entity[doorE[door_number[e]]]['animating'] = 1 end pressed = 1 end end end end if pressed == 1 and g_KeyPressE == 0 then pressed = 0 end end