[lua]local PoisonZombie = {}
PoisonZombie[PLAYER_IDLE] = ACT_IDLE
PoisonZombie[PLAYER_WALK] = ACT_WALK
PoisonZombie[PLAYER_JUMP] = ACT_WALK
PoisonZombie[PLAYER_ATTACK1] = ACT_MELEE_ATTACK1
PoisonZombie[PLAYER_SUPERJUMP] = ACT_RANGE_ATTACK2
function PoisonZombieAnim(ply, anim)
local act = ACT_IDLE
local speed = ply:GetVelocity():Length()
if PoisonZombie[anim] != nil then
act = PoisonZombie[anim]
else
if speed > 0 then
act = ACT_WALK
end
end
if act == ACT_IDLE_ON_FIRE then
if speed > 0 then
act = ACT_WALK_ON_FIRE
end
end
if act == ACT_MELEE_ATTACK1 or anim == PLAYER_SUPERJUMP then
ply:SetPlaybackRate(2)
ply:RestartGesture(act)
return true
end
local seq = ply:SelectWeightedSequence(act)
if act == ACT_WALK then
seq = 3
end
if seq == 3 then
ply:SetPlaybackRate(1.5) //walk
else
ply:SetPlaybackRate(1.0)
end
if ply:GetSequence() == seq then return true end
ply:ResetSequence(seq)
ply:SetCycle(0)
return true
end[/lua]
How would I Get this to function with Zombine Animations?