what does it sing? pop, classic, rock?
the video is set to private but is this done with 1 animation on loop? will all the models have the same animation frames? as you will likely want to check the animation is at a decent point for applying the damage it's useful to try make them all the same or you will need to edit the script for each one to assign the different "damage" frames.
this script assumes a swinging axe on 1 loop going one direction and then the other (i.e. anim0 = 0,100 where 0,49 is left to right and 50,100 is right to left)
swinging_axe_trap.lua
local damage_range = {}
local damage = {}
local min_damage_frame1 = {}
local max_damage_frame1 = {}
local min_damage_frame2 = {}
local max_damage_frame2 = {}
function swinging_axe_trap_init(e)
damage[e] = 1 --how much damage to apply per 0.25s
damage_range[e] = 125 --how close the player can get before damage is applied
min_damage_frame1[e] = 20 --starting frame to apply damage at in first direction
max_damage_frame1[e] = 30 --maximum frame to apply damage to in first direction
min_damage_frame2[e] = 70
max_damage_frame2[e] = 80
end
function swinging_axe_trap_main(e)
if g_Entity[e]['animating'] == 0 then
SetAnimation(0)
LoopAnimation(e)
g_Entity[e]['animating'] = 1
end
if GetPlayerDistance(e) <= damage_range[e] then
if (GetAnimationFrame(e) >= min_damage_frame1[e] and GetAnimationFrame(e) <= max_damage_frame1[e]) or (GetAnimationFrame(e) >= min_damage_frame2[e] and GetAnimationFrame(e) <= max_damage_frame2[e]) then
if GetTimer(e) > 250 then
StartTimer(e)
HurtPlayer(e,damage[e])
end
end
else
StartTimer(e)
end
end --main
edit; i should say i didnt test this so if you get any errors let me know and i'll fix it
life\'s one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11