@name FailCake Ultimate Button
@persist E:entity
@persist Ply:array
@persist Finding Active Event
@trigger all
@model models/weapons/c_models/c_pda_engineer/c_pda_engineer.mdl
interval(100)

#hl1/ambience/port_suckout1.wav

if(first() | duped())
{
E = entity()
Finding = 1  

holoCreate(1)
holoModel(1,"hqicosphere") 
holoPos(1,E:toWorld(vec(20,0,0)))
holoScale(1,vec(1,1,1))
holoParent(1,E)
}





findByClass("player")
Ply = findToArray()

if(Finding){
for(I = 1,Ply:count()){
    
if(Ply[I,entity]:keyUse() && Ply[I,entity]:aimEntity() == E && Ply[I,entity]:pos():distance(E:pos()) < 70){
Finding = 0
Active = 1
E:soundPlay(1,0,"/buttons/button5.wav")    
}
    
}
}

if(Active){
Event+=0.1

if(Event == 2){
soundStop(1)
E:soundPlay(2,0,"/ambient/halloween/underground_wind_lp_04.wav")  
E:soundPlay(1,0,"/hl1/fvox/activated.wav")    
}

if(Event == 4){
soundStop(1)
E:soundPlay(1,0,"/hl1/fvox/powermove_overload.wav")     
}

if(Event == 15){
soundStop(1)
E:soundPlay(1,0,"/hl1/fvox/evacuate_area.wav")     
}
    
}
