Basically, it's a first-person death script. Whenever you die, your view is wherever your head is looking. However, it doesn't work. How can I fix this?
if( CLIENT ) then local function CalcView( pl, origin, angles, fov ) local ragdoll = pl:GetRagdollEntity(); if( !ragdoll || ragdoll == NULL || !ragdoll:IsValid() ) then return; end local eyes = ragdoll:GetAttachment( ragdoll:LookupAttachment( "eyes" ) ); local view = { origin = eyes.Pos, angles = eyes.Ang, fov = 90, }; return view; end hook.Add( "CalcView", "DeathView", CalcView ); end
Errr, this script is a mish mash of Java and Lua. Of course it's not going to work.