@name Script NPC
@inputs 
@outputs 
@persist I T E:entity JJ L
@trigger 
if(first()){
    I = 1
    JJ = 0
holoCreate(0)
holoModel(0,"models/Humans/Group01/Male_04.mdl")
holoAnim(0,10)
holoSetPose(0,"move_scale",1)
 holoSetPose(0,"move_y",18)
 holoSetPose(0,"move_yaw",0)
L = 2

}
runOnTick(1)

if(changed(owner():keyPressed("g")) & owner():keyPressed("g")){
    I++
    T = I - 1
    holoCreate(I)
    holoPos(I,owner():pos())
    holoAng(I,owner():eyeAngles():setPitch(0):setRoll(0))
    
}



if(changed(owner():keyPressed("h")) & owner():keyPressed("h")){
    E = propSpawn("models/props_junk/PopCan01a.mdl",entity():toWorld(vec(0,0,5)),0)
timer("for",100)
}





if(clk("for")){
 holoCreate(999+I)
holoPos(999+I,E:pos())  
JJ = 1
}



if(JJ==1){
 holoPos(0,E:pos())   
}




        E:applyForce((holoEntity(L):pos() - E:pos())-E:vel()*E:mass()-10)
holoAng(0,(holoEntity(L):pos() - holoEntity(L-1):pos()):toAngle():setPitch(0):setRoll(0))



if(clk("for")){
 HPOS = holoEntity(0):pos()
NPOINTPOS = holoEntity(999+I):pos()   
TPOS = holoEntity(T):pos()
#    holoPos(0,holoEntity(0):pos() - NPOINTPOS)


}
if(holoEntity(L)){
    if(E){
if(E:pos():distance(holoEntity(L):pos())<15)   {
    L++
    print("YAY")
    

}
}}
if(L>I){
L = 2}
