local etat = {} local deplace = {} local deplace_max = {} function porte_verticale_init(e) etat[e] = "close" deplace_max[e] = 600 --Hauteur de déplacement maxi de la porte CollisionOn(e) end function porte_verticale_main(e) if etat[e] == "close" then if GetPlayerDistance(e) < 150 then Panel(25,60,55,70) TextCenterOnXColor(40,65,1,"Appuyez sur E pour ouvrir la porte...",255,0,0) if g_KeyPressE == 1 then deplace[e] = 0 etat[e] = "ouverte" end end elseif etat[e] == "ouverte" then if deplace[e] < deplace_max[e] then deplace[e] = deplace[e] + 1 CollisionOff(e) SetPosition(e,g_Entity[e]['x'],g_Entity[e]['y']+0.25,g_Entity[e]['z']) CollisionOn(e) end end end