Death Animation, how to?

This is my attempt so far:
CLIENT
[lua]hook.Add(“UpdateAnimation”, “hooktryingtomakeplayerdie64”, function( ply )
for k, v in pairs (player.GetAll()) do
if v.dying then
v:SetPlaybackRate( 1 )
end
end
end)

hook.Add(“CalcMainActivity”, “hooktryingtomakeplayerdie32”, function( ply )
for k, v in pairs (player.GetAll()) do
if v.dying then
return 1, v:LookupSequence(“ACT_GMOD_DEATH”)
end
end
end)[/lua]

SERVER
[lua]
hook.Add(“UpdateAnimation”, “hooktryingtomakeplayerdie64”, function( ply )
if ply.dying then
ply:SetPlaybackRate( 1 )
end
end)

hook.Add(“CalcMainActivity”, “hooktryingtomakeplayerdie”, function( ply )
if ply.dying then
return 1, ply:LookupSequence(“ACT_GMOD_DEATH”)
end
end)[/lua]

Yet it keeps playing the animation after death. What am I doing wrong?
And doesn’t play at all for other players
(And I am sending ply.dying to client correctly)

I’ve never used animations or even tried modifying them, but perhaps you need to reset it to it’s normal state, as once it is set to that, it does not toggle off when the player spawns?

That’s not the problem it doesn’t stop the animation it keeps looping, it correctly stops when spawned.
What’s more it won’t work for other players (I can’t see them in death animation nor can they see themselves)