@name Holo Scrolling
@inputs 
@outputs 
@persist Val_a Val_d Val_A Val_other_d SideMult E:entity User:entity
runOnTick(1)

if (first()) {
    User = findPlayerByName("Divalent")
    E = entity()
    
    for (I = 1,5) {
        holoCreate(I)
        holoPos(I,E:toWorld(vec(0,-42+14*I,10)))
        
        holoParent(I,3)
        holoParent(I-2,3)
        
        holoClipEnabled(I,1,1)
        holoClip(I,E:pos() + vec(0,-38,0),vec(0,1,0),1)
        
        holoClipEnabled(I,2,1)
        holoClip(I,2,E:pos() + vec(0,38,0),vec(0,-1,0),1)
    }
}

if (User:keyUse()) {
    Val_d = E:pos():x() - User:pos():x()
    Val_A = User:eyeAngles():yaw()
    Val_a = Val_d * tan(Val_A)
    
    Val_other_d = abs(E:pos():y() - User:pos():y())
    
    holoPos(3,E:pos() + vec(0,Val_a + Val_other_d,10))
}
