@name Bone Scanner
@inputs C Pitch Yaw
@outputs C Count Pos:vector On Fade
#@persist C
@trigger all
interval(20)
#if(C<(Count-1)&Count!=1){C++}else{C=1}
E=entity():owner():aimEntity()
Count=E:boneCount()
C=abs(C)

B=E:bone(C)

Pos=B:pos()
#B:applyForce(vec(0,0,15000))

if(Count&Count!=1){On=1}else{On=0}

Fade=255

#HL2 ragdoll, 15 bone count Scruffy, alyx? 
#0=hips
#1=gut
#2=right shoulder
#3=left shoulder
#4=left elbow
#5=left wrist
#6=right elbow
#7=right wrist
#8=right hip joint
#9=right knee
#10=head 
#11=left hip joint
#12=left knee
#13=left ankle
#14=right ankle

#Vort
#0=hips
#1=gut
#2=right shoulder
#3=left shoulder
#4=left elbow
#5=left wrist
#6=right elbow
#7=neck
#8=right wrist
#9=right hip joint
#10=right knee upper
#11=right knee lower
#12=right ankle
#13=left hip joint
#14=left knee upper
#15=left knee lower
#16=left ankle
#17=head

Off=On
if(Off){
Amp=100
Center=B:massCenter()
OffsetF=B:forward()*Amp
OffsetR=B:right()*Amp
MoveVector=vec(Pitch,Yaw,0)
B:applyOffsetForce(MoveVector,Center+OffsetF)
B:applyOffsetForce(-MoveVector,Center-OffsetF)
B:applyOffsetForce(MoveVector,Center+OffsetR)
B:applyOffsetForce(-MoveVector,Center-OffsetR)
}
