@name FailCake Glass ORama
@inputs 
@outputs Timeout On Ply:entity
@persist 
@trigger all
runOnTick(1)

O = owner()
E = entity()

if(first()){
    
propSpawnEffect(0)
E:setAlpha(100)
On = 0

}

if(Ply:health() <= 0 & On == 1){
Ply:soundPlay(100,100,"achievements/achievement_earned.mp3")  
O:soundPlay(100,100,"achievements/achievement_earned.mp3")      
On = 0     
}else{

if(On == 0){
Ply = noentity()
}

}


if(O:keyAttack2() & Timeout == 0){
Timeout = 1

if(O:aimEntity():isPlayer() | O:aimEntity():isNPC()){
Ply = O:aimEntity()
On = 1
Prop = propSpawn("models/props/CS_militia/skylight_glass.mdl",O:aimEntity():pos()+vec(0,0,500),ang(0,0,0),0)    
}
}

if(Timeout){
timer("wait",600)
if(clk("wait")){
stoptimer("wait")
Timeout = 0    
}    
}
