-- Play Assigned Video If Entity Hit/Shot
-- cybernescence
function playvideoifhit_init(e)
end
function playvideoifhit_main(e)
if ai_old_health[e] == nil then
ai_old_health[e] = g_Entity[e]['health']
return
end
if g_Entity[e]['health'] < ai_old_health[e] then
--PlaySound(e,0)
ai_old_health[e] = g_Entity[e]['health']
PlayVideo(e,1)
Destroy(e)
end
end
Edit: I forgot to add some instructions. Copy the script above into a file and name it playvideoifhit.lua in the scriptbank folder. Then open properties of your camera entity and assign this script in the 'Main' property. Also set 'Static Mode' to 'No' (to make it active and able to run the script), make sure 'Strength' (health) has a value, say 25. And add your video into the 'Sound1' property slot at the bottom (place your video in the videobank folder and select it from there).
Cheers.