@name Polivator
@inputs Down Up MoreUp MoreDown 
@outputs Floor Target Height
@persist Elestart Elevator:entity Speed Direct
@trigger all
if(first()){
Elevator = rangerAngle(10,0,180):entity()
Elestart = Elevator:pos():z()
Target = 1
Speed = 90
}

interval(100)
if(Up & ~Up){ Target += 1 Speed=0 Direct=1}
if(Down & ~Down & Target >1) {Target -= 1 Speed=0 Direct=-1}
if(MoreUp & ~MoreUp) {Target += 10 Speed=0 Direct=1}
if(MoreDown & ~MoreDown & Target >10) {Target -= 10 Speed=0 Direct=-1} 
if(MoreDown & ~MoreDown & Target <= 10) {Target = 1 Speed=0 Direct=-1}
Height = (Target)*98.9*sin(Speed*Direct) + Elestart
Height1 = (Target)*98.9+Elestart
if(Height!=Height1) {Speed+=10}
if(Speed > 90) {Speed = 90}

Floor = round(((Elevator:pos():z() - Elestart )/98.9)+1)
