@name Defy Gravity
@inputs Stop
@outputs Count1 Count2
@persist A1:array A2:array Find
# Defy Gravity (by chinoto)

#Description: Uses force functions and while loops to make a bunch of entities defy gravity and to a small extent, velocity.



runOnTick(1)
if (findCanQuery()) {
    Find=(Find+1)%2
    findClearBlackList(),findClearWhiteList()
    findIncludePlayerProps(owner())
    if (Find==0) {
        findByClass("prop_physics")
        A1=findToArray()
    }
    if (Find==1) {
        findByClass("sent_ball")
        A2=findToArray()
    }
}

if (!Stop) {
    Gravity=vec(0,0,9.015)
    Count1=A1:count()
    T=0
    while ((T<Count1)&(minquota()>100)) {
        T++,TE=A1[T,entity]
        TE:applyForce((Gravity-TE:vel()/100)*TE:mass())
    }

    Count2=A2:count()
    T=0
    while ((T<Count2)&(minquota()>100)) {
        T++,TE=A2[T,entity]
        TE:applyForce((Gravity-TE:vel()/100)*TE:mass())
    }
}
