ok got it sorted
Here is a script to countdown to 0 and kill the player.... just add it to a trigger zone to start.
There is also a script to halt the countdown too, just add that to a zone a little further away
-- Player Enters a trigger zone, and the countdown to his death begins. --
-- killcounter and detonator can be reset using another script like a switch script or your own script --
-- So far there is no stopping the countdown in this script --
-- Tarkus1971 --
local detonation
local gt
function countdown_init(e)
detonation = 0
detonator = 0
killcounter = 21
end
function countdown_main(e)
if g_Entity[e]['plrinzone']==1 and detonator == 0 then
detonator = 1
-- Destroy(e)
ActivateIfUsed(e)
end
if detonator == 1 then
if killcounter > 0 then
killcounter = killcounter - .025
Prompt("Countdown " ..math.floor(killcounter))
if math.floor(killcounter) <= 0 then
HurtPlayer(e,g_PlayerHealth)
detonator = 2
end
end
end
end
-- Script to reset and stop the countdown.lua script --
-- Tarkus1971 --
function detonator_off_init(e)
end
function detonator_off_main(e)
if g_Entity[e]['plrinzone']==1 then
detonator = 0
PromptDuration("Countdown Stopped at " ..math.floor(killcounter),3000)
killcounter = 21
Destroy(e)
ActivateIfUsed(e)
end
end
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, AMD HD7870 gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit.
http://contest.gamedevfort.com/submission/185#.Vd9sJflVhBd