• 3tp Camera
    0 replies, posted
Hello to all! How to make if I look straight but run to the left, my character ran to the left? CODE: if (CLIENT) then hook.Add("Think","", function() gui.EnableScreenClicker(not input.IsMouseDown( MOUSE_RIGHT )) end) end if( CLIENT ) then function ThirdPersonUmsg( data ) if( LocalPlayer().ThirdPerson == nil ) then LocalPlayer().ThirdPerson = true; else LocalPlayer().ThirdPerson = !LocalPlayer().ThirdPerson; end; end; usermessage.Hook( "ThirdPerson", ThirdPersonUmsg ); local iMinDistance = 0 local iMaxDistance = 100 local wp = vgui.GetWorldPanel() wp:SetCursor("crosshair") wp:MouseCapture(false) local dist = 0 function wp:OnMouseWheeled(delta) if delta > 0 then dist = math.Clamp(dist + 5, iMinDistance, iMaxDistance) elseif delta < 0 then dist = math.Clamp(dist - 5, iMinDistance, iMaxDistance) end end function ThirdPerson( ply, pos, ang, fov ) if( LocalPlayer().ThirdPerson ) then local view = {}; local trace = {}; trace.start = pos; trace.endpos = pos - ( ang:Forward() * dist ); trace.filter = LocalPlayer(); local trace = util.TraceLine( trace ); if( trace.HitPos:Distance( pos ) < dist - 10 ) then dist = trace.HitPos:Distance( pos ) - 10; end; view.origin = pos - ( ang:Forward() * dist ); view.angles = ang; view.fov = fov; return view; end; end; hook.Add( "CalcView", "ThirdPerson", ThirdPerson ); function ThirdPersonSDLP() if( LocalPlayer().ThirdPerson ) then return true; end; end; hook.Add( "ShouldDrawLocalPlayer", "ThirdPersonSDLP", ThirdPersonSDLP ); else function ToggleThirdPerson( ply ) umsg.Start( "ThirdPerson", ply ); umsg.End(); end; hook.Add( "ShowTeam", "ToggleThirdPerson", ToggleThirdPerson ); end; https://files.facepunch.com/forum/upload/159605/4e0198db-228c-4a66-8a35-73fb652ffad4/n88efkzV_rM.jpg
Sorry, you need to Log In to post a reply to this thread.