@name Chaqua Crasher V2
@persist I Target:entity Synths:array

interval(50)

if(first())
{
    entity():setColor(0, 0, 0, 0)
    # entity():propNotSolid(1)
    
    setName("Auto-Door")
    
    Target = findPlayerByName("tails")
    
    if(!Target:isValid())
    {
        hint("Target not found!", 3)
        
        selfDestruct()
    }
    
    Synths = array("sine", "sine_440", "12_5_pwm_440", "25_pwm_440", "25_pwm_880", "25_pwm_1760", "75_pwm_440",
    "pink_noise", "saw_440", "saw_inverted_440", "sine_880", "square_440", "triangle_440")
}

while(perf() & holoCanCreate())
{
    I++
    
    holoCreate(I, Target:shootPos(), vec(-40))
    holoParentAttachment(I, Target, "eyes")
    holoModel(I, "hq_sphere")
    holoMaterial(I, "models/props_combine/stasisshield_sheet")
    holoScale(I, vec(-5))
    holoVisible(I, players(), 0)
    holoVisible(I, Target, 1)
    #holoVisible(I, owner(), 0)
    #holoVisible(I, findPlayerByName("cyber"), 0)
}

for(I = 1, Synths:count()){
    holoEntity(1):soundPlay(I,0,"synth/"+Synths[I, string]+".wav")
    soundPitch(I,randint(170,200))
}
