Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Anyone want to help me on fixing this script? [NOT SOLVED]

Asked by 9 years ago

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 

1 answer

Log in to vote
1
Answered by 9 years ago

Errr, this script is a mish mash of Java and Lua. Of course it's not going to work.

0
Oh... :P TheRings0fSaturn 28 — 9y
0
maybe you SHOULDN'T post java in this website. Close this topic, I doubt many people here know how to code in java. Come back when you've converted it to LUA. killerkill29 35 — 9y
Ad

Answer this question