@name FailCake Lost Pc FailSafe
@inputs Activate
@outputs Explode Reset On 
@persist Player:entity A:array Tim
@trigger all
@model models/props_lab/harddrive02.mdl
runOnTick(1)

E = entity()
O = owner()

if(first()){
    On = 0
    Reset = 0
    findByClass("player")
    A=findToArray() 
}

if(Activate){
    
for(I=1,A:count()){
if(A[I,entity]:keyUse() & A[I,entity]:aimEntity()==entity() & On == 0 & A[I,entity]:pos():distance(entity():pos())<= 70)
{
Player = A[I,entity]

On = 1
hint("Turned On",100)

}
}
if(On){
Tim+=0.1   
Explode = 1
if(Tim == 1){
}
if(Tim == 5){
E:soundPlay(5,999,"misc/hologram_stop.wav") 
} 
if(Tim == 1){
E:soundPlay(4,999,"ambient/levels/labs/machine_stop1.wav")     
}
if(Tim == 8){
E:soundPlay(3,999,"ambient/levels/labs/electric_explosion1.wav")     
}
if(Tim == 11){
E:soundPlay(3,999,"ambient/levels/labs/electric_explosion2.wav")     
Reset = 1
}
if(Tim >= 12){
Explode = 0
Reset = 0 
On = 0
Activate = 0
Tim = 0 
}
} 

}else{
Tim = 0
On = 0
Reset = 0
Explode = 0
}

####################################################################
## Do not rename the E2 or remove the hint("Made by Failcake",100)##
####################################################################
