that's not going to work with the current set up then, the issue would be that once the character is killed it'll no longer run the script (hence the exit)
you will need a new script which checks for the characters death i called this ally_dead.lua
set it on a dynamic object that's always active
function ally_dead_init(e)
dead = 0
local delay = 0
end
function ally_dead_main(e)
if dead == 1 then
PromptDuration("You killed an Ally!",2000)
delay = GetTimer(e) + 2000
dead = 2
elseif dead == 2 then
if GetTimer(e) > delay then
SetPlayerLives(e,0)
HurtPlayer(e,g_PlayerHealth)
dead = 3
end
end
end
and change the ai_soldier.lua exit part to this
function ai_soldier_exit(e)
PlayCharacterSound(e,"onDeath")
dead = 1
end
let me know if you have any issues
edit; code snippets not working correctly
life\'s one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11