@name Ruad Legs
@persist [E E2]:entity
interval(100)
if(first())
{
    
    function ikS(Dist,I1,I2,Src:vector,End:vector)
    {
        local D = Src-End
        local L = min(D:length(),Dist)
        local A1 = D:toAngle()
        local A2 = ang(-asin(L/Dist),0,0)
        holoAng(I1,A1+A2)
        holoAng(I2,A1-A2)
    }
    function ikSI(Dist,I1,I2,Src:vector,End:vector)
    {
        local D = Src-End
        local L = min(D:length(),Dist)
        local A1 = D:toAngle()+ang(180,0,0)
        local A2 = ang(asin(L/Dist),0,0)
        holoAng(I1,A1+A2)
        holoAng(I2,A1-A2)
    }
    
    
    E = entity()
    E2 = propSpawn("models/hunter/blocks/cube025x025x025.mdl",E:pos()+vec(0,0,25),0)
    
    holoCreate(1)
    holoCreate(2,E:toWorld(vec(0,0,75))) #This number x2 goes into the first parameter at line 50
    holoCreate(3)
    
    holoParent(1,E)
    holoParent(2,1)
    holoParent(3,2)
    
    holoAlpha(1,0)
    holoAlpha(2,0)
    
    holoCreate(4)
    holoCreate(5,E:toWorld(vec(0,0,30))) #That number x2 goes into the first parameter and Z value of that vector at line 51.
    holoCreate(6)
    
    holoParent(4,E)
    holoParent(5,4)
    holoParent(6,5)
}

ikS(150,1,2,E:pos(),E2:pos())
ikSI(60,4,5,E:pos(),E2:pos()+vec(0,0,50))
