@name Dynamic Jumper
@inputs PDist
@outputs Velocity Distance Pitch Ang PlayerVelocity
#@outputs RecAngle Fire H
#@outputs Appogy:vector 
@persist X2 XYZ:vector Player:entity
interval(20)
Forcer=entity():isConstrainedTo()
Pos=Forcer:pos()
Owner=entity():owner()
Check=Owner:aimEntity()!=Forcer|Owner:aimEntity()!=entity()
OD=Owner:pos():distance(entity():pos())
if(Owner:keyUse()&OD<100&Check){XYZ=Owner:aimPos()}

if(first()|dupefinished()){
    holoCreate(1,Forcer:pos()+Forcer:forward()*5,vec(1,0.05,0.05))
    holoParent(1,Forcer)
    holoColor(1,vec(255,0,0))
}
Ang1=Forcer:angles()
Pitch=Ang1:pitch()-90*-1
#Yaw=Ang1:yaw()
#Roll=Ang1:roll()
Ang=abs(Pitch)
#X2=abs((X^2+Y^2+Z^2)^0.5-(X1^2+Y1^2+Z1^2)^0.5)
X2=XYZ:distance(Pos)
G=600
Velocity=0

Distance=X2

findInSphere(Pos,500)
findIncludeClass("player")
findSortByDistance(Pos)
Pl=findResult(1)
PDist=Pl:pos():distance(Pos)
Jump=!Pl:isOnGround()&!Pl:inNoclip()
#Jump=1

if((PDist<70 & PDist!=0) & Jump) {
Velocity=((X2*G)/sin(2*Ang))^0.5
Player=Pl
}
PlayerVelocity=Player:vel():length()

#
#X=Pos:x()
#Y=Pos:y()
#Z=Pos:z()

#X1=XYZ:x()
#Y1=XYZ:y()
#Z1=XYZ:z()

#if(PDist){timer("wait",500)}
#if(clk("wait")){Fire=1 timer("Fire",2000)}
#if(clk("Fire")){Fire=0}
#if(Fire) {Velocity=((X2*G)/sin(2*Ang))^0.5}else{Velocity=0}


#RecAngle = (1/2)*asin((G*X2)/Velocity^2)
#
#H=Z+X2*tan(Ang)-(G*X2^2)/(2*(Velocity*cos(Ang)))^2*-1
##Velocity=sqrt(-G*X2^2)/(cos(Ang)*sqrt(2*(H-Z-X2*tan(Ang))))
#X3=((X1-X)/2)+X
#Y3=((Y1-Y)/2)+Y
#Z3=H+Z
#Appogy=vec(X3,Y3,Z3)

