@name FailCake HE Granade
@inputs Insta
@outputs A:array Once StartSmoke Bum
@persist Player:entity Click Timer SmokeTime SmokeTimer2
@trigger all
@model models/Items/grenadeAmmo.mdl

interval(100)
E = entity()
E:setMass(10)
E:setColor(255,0,0)
if(first()){
    E:removeTrails()
    findByClass("player")
    A=findToArray()
}

for(I=0,A:count()){
    Player = findResult(I)
    if(Player:keyUse() & Player:aimEntity()==entity() & Once==0){
hint("Acti",100)
Once = 1
}
}
if(Once | Insta == 1){
Timer += 0.1
Click += 0.5
if(Timer == 1){
E:setTrails(10,10,5,"trails/laser",vec(255,0,0),200)
}
if(Click == 2){
E:soundPlay(1000,1000,"weapons/grenade/tick1.wav")
}

if(Click >= 4){
soundStop(1000)
Click = 0
}

if(Timer >= 5 & Timer <= 6){
goBoom(entity():pos(),10000)
}else{
if(Timer >= 6){
selfDestructAll()
}
}
}
