@name Escalator - By Moglizorz
@persist List:array Max Plus PlusO Counter Y
runOnTick(1)
X=840, Y=0, Z=0 # Elevator position, default is 840,0,0
findIncludePlayerProps(owner())
findByModel("models/props_phx/construct/metal_plate2x4.mdl")
if(Max!=findToArray():count()){
    List = findToArray()
    Max=List:count() }
PlusO+=1
if(PlusO>100){PlusO=0, List:insertEntity(2,List:entity(Max))}
Z=Z-480
while(opcounter()<maxquota()){
    Counter++
    if((Counter>2)&(Counter<Max)){
        Plus=Counter*100+PlusO-100
        EE=List:entity(Counter)
        EE:applyAngForce(-(EE:angles()*20+EE:angVel())*5*EE:inertia():length()/sqrt(3))
        EE:applyForce(((vec(0+X+Plus,0+Y,0+Z+Plus)-EE:massCenter())*10-EE:vel())*EE:mass())
    }elseif(Counter==Max){
        Plus=Counter*100+PlusO-100
        EE=List:entity(Counter)
        EE:setMaterial("phoenix_storms/dome")
        EE:setColor(150,150,150,255)
        EE:setMass(50000) 
        EE:applyAngForce(-(EE:angles()*20+EE:angVel())*5*EE:inertia():length()/sqrt(3))
        EE:applyForce(((vec(0+X+Plus,0+Y,0+Z+Counter*100-100)-EE:massCenter())*10-EE:vel())*EE:mass())
    }elseif(Counter==2){
        Plus=(Max-1)*100
        EE=List:entity(Counter)
        EE:applyAngForce(-(EE:angles()*20+EE:angVel())*5*EE:inertia():length()/sqrt(3))
        EE:applyForce(((vec(0+X+Plus,0+Y,0+Z)-EE:massCenter())*10-EE:vel())*EE:mass())
    }elseif(Counter==1){
        Plus=(Max)*100
        EE=List:entity(Counter)
        EE:applyAngForce(-(EE:angles()*20+EE:angVel())*5*EE:inertia():length()/sqrt(3))
        EE:applyForce(((vec(0+X+Plus,0+Y,0+Z+Plus-99.8)-EE:massCenter())*10-EE:vel())*EE:mass())
        EE:setMaterial("phoenix_storms/dome")
        EE:setColor(150,150,150,255)
        EE:setMass(50000) 
    }else{Counter=0} }
