@name Dog Targeter
@inputs 
@outputs 
@persist Dog:array
@trigger 
interval(500)
findInSphere(entity():pos(),60000)
findIncludeClass("dog")
Dog=findToArray()
O=owner()
Aim=O:aimEntity()
if(Aim&O:keyUse()&O:isCrouch()){
    if(O:weapon():type():find("tool")){
        Tar=Aim:npcGetTarget()
        if(Tar){
            print("This Dog throws to: "+Tar:name())
        }else{
            print("This Dog has no target!")
        }
    }
    if(O:weapon():type():find("physgun")){
        for(C=1,Dog:count()){
            Dog[C,entity]:npcSetTarget(Aim)
            print("Dog "+Dog[C,entity]:id()+" is targeting "+" "+Aim:name())
        }
    }    
    if(O:weapon():type():find("physcannon")){
        for(C=1,Dog:count()){
            Dog[C,entity]:npcSetTarget(O)
            print("Dog "+Dog[C,entity]:id()+" is targeting "+" "+O:name())
        }
    }    
}

