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) <= 100 then if g_Entity[doorE[door_number[e]]] ~= nil then if g_Entity[doorE[door_number[e]]]['animating'] == 0 then if open[door_number[e]] == 0 then Prompt("Press E to interface") if g_KeyPressE == 1 and pressed == 0 and g_Entity[doorE[door_number[e]]]['animating'] == 0 then open[door_number[e]] = 1 SetAnimation(0) PlayAnimation(doorE[door_number[e]]) CollisionOff(doorE[door_number[e]]) g_Entity[doorE[door_number[e]]]['animating'] = 1 pressed = 1 end else Prompt("Press E to cancel interface") if g_KeyPressE == 1 and pressed == 0 and g_Entity[doorE[door_number[e]]]['animating'] == 0 then open[door_number[e]] = 0 SetAnimation(1) PlayAnimation(doorE[door_number[e]]) CollisionOn(doorE[door_number[e]]) g_Entity[doorE[door_number[e]]]['animating'] = 1 pressed = 1 end end else if open[door_number[e]] == 1 then Prompt("Door is opening...") else Prompt("Door is closing...") end end end end if pressed == 1 and g_KeyPressE == 0 then pressed = 0 end end