@name Distraction! Grenade
@model models/Items/grenadeAmmo.mdl
@persist Tick Ready Prepare Exploded
if (Ready & Prepare) {
    setName(" ")
    entity():setTrails(3,3,1.3,"trails/laser",vec(255,0,0),255)
    Prepare=0
} else {
    setName("Distraction! Grenade
    By Scriptis")
}

if (entity():isPlayerHolding()) {Prepare=1}
if (Prepare & !entity():isPlayerHolding()) {
    Ready=1
}
if (Ready) {
Tick++
if (!Exploded) {
soundPlay(0,0,"/weapons/grenade/tick1.wav")
}
if (Tick>=randint(10,15) & !Exploded) {
    soundPlay(0,0,"/ambient/explosions/explode_1.wav")
    timer("Destruct",2000)
    entity():setAlpha(0)
    entity():removeTrails()
    Exploded=1
}
}
interval(random(300,400))
if (clk("Destruct")) {selfDestruct()}
if (!Ready) {runOnTick(1)} else {runOnTick(0)}
