@name NPC
@inputs 
@outputs 
@persist Array:array Distance Result:string Times Damage HoloDist Circle X Y
@trigger 


#########################################
# Base code by Ratman - Thanks so much! # 
#########################################



interval(5000)
timer("check",5000)
## SETTINGS!
#Distance
Distance = 250
#Player's that wont be killed E.G "findExcludePlayer("Rick")".

#findExcludePlayer(owner())

#Result (slay, jail, strip, slap, ragdoll)
Result = ""
#Only if you are using slap!
Times = 100
Damage = 20
#
##SETTINGS



if (first()) {
    holoCreate(1)
    holoAlpha(1, 0)
    
    
    

}
if (first()) {
    holoCreate(2)
    holoAlpha(2, 0)
    
    
    

}
entity():setAlpha(0)
##HOLO

Circle += 0.1

X = Distance*sinr(10*Circle)
Y = Distance*cosr(10*Circle)


holoPos(1, entity():pos() + vec(X,Y,0))
holoPos(2, entity():pos() + vec(X,0,Y))
holoParent(1, entity())
holoParent(2, entity())


##HOLO

R = array(
"vo/npc/male01/hi01.wav",
"vo/npc/male01/hi02.wav",
"vo/npc/male01/answer31.wav",
"vo/npc/male01/answer32.wav",
"vo/npc/male01/answer33.wav",
"vo/npc/male01/answer34.wav",
"vo/npc/male01/answer35.wav",
"vo/npc/male01/answer36.wav",
"vo/npc/male01/answer37.wav",
"vo/npc/male01/answer38.wav",
"vo/npc/male01/answer39.wav",
"vo/npc/male01/answer40.wav")

if (clk("check")) {
    findInSphere(entity():pos(), Distance)
    Array = findToArray()

    for(I=1,Array:count()) {
        if(Array[I,entity]:isPlayer()) {
            if(Array[I,entity]:isAlive()) {
                if (Result != "whip") {
                holoEntity(3):soundPlay(0,0,R:string(randint(0,R:count())))
                    #concmd("say get away from me" + Result + " " + Array[I,entity]:name():sub(1,25) + "")
                } else {
                    #concmd("say get away i said" + Result + " " + Array[I,entity]:name():sub(1,5) + " " + Times + "" + Damage + "")
                }
            }
        }
    }
}


E = entity()

holoCreate(3)
holoModel(3, "models/Humans/Group01/male_07.mdl")
holoAnim(3,2)
holoParent(3,E)







