Try this:
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
-- Detonate timebomb
timebomb_started=0
function timebomb_init(e)
end
function timebomb_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 90 and timebomb_started == 0 then
Prompt ("Press E to activate time bomb")
if g_KeyPressE == 1 then
PromptDuration("Timebomb activated - Run", 2000)
timebomb_started = GetTimer(e)+2500
PlaySound(e,0)
end
end
if timebomb_started>0 then
if GetTimer(e) > timebomb_started then
SetEntityHealth(e,0)
timebomb_started=0
end
end
end
Corno_1
My dream is to develope games, which makes fun when I create it and fun when other people play it.