@name Flying Follower Base
@persist [E]:entity [V V1]:vector [A]:angle Act Act2
@model models/hunter/plates/plate05x05.mdl
if(first())
{
    runOnTick(1)
    E = entity()
    E:propFreeze(0)
    E:setMass(500)
    
    Act = 1
    Act2 = 1
    
    function entity:turnTo(Tarang:angle)
    {
        local V = This:toLocal(rotationVector(quat(Tarang)/quat(This))+This:pos())
        This:applyTorque((100*V - 20*This:angVelVector())*This:inertia()/3)
    }
}

if(Act)
{
    applyForce((V1-(E:vel()/10))*E:mass())
    E:turnTo(A)
    
    V = owner():pos()
    
    if(Act2)
    {
        #[
            I have all of these variables to explain what these things are. Here is what it should normally be:
            V1 = vec(0,0,((V:z()+100)-E:pos():z())/5)+E:forward()*(V:distance(E:pos())>125)*50
        ]#
        local UpMovement = vec(0,0,((V:z()+100)-E:pos():z())/5)
        local StartFlying = (V:distance(E:pos())>125)
        local Speed = 50
        V1 = UpMovement+E:forward()*StartFlying*Speed
        A = (V-E:pos()):toAngle():setPitch(0)
    }
}
