Add the two scripts together and add a look back funtion for q and e for left and right

-- Improved First-Person Camera Script --

-- Place in StarterGui or StarterPack -- -- Credit: -- -- EvelienSterk, SawyerDGamer, iytgggggg, and others contributing to base script -- -- Update: Shows body but hides head and hair, includes smooth controls --

-- Services local runService = game:GetService("RunService") local input = game:GetService("UserInputService") local players = game:GetService("Players")

-- Configuration local CanToggleMouse = {allowed = true, activationkey = Enum.KeyCode.F} -- Toggle mouse movement in first-person local CanViewBody = true -- Whether body is visible local Sensitivity = 0.2 -- Mouse sensitivity local Smoothness = 0.05 -- Smoothness factor for camera movement local FieldOfView = 90 -- Field of view for the camera

-- Initial Setup local cam = game.Workspace.CurrentCamera local player = players.LocalPlayer local m = player:GetMouse() m.Icon = "http://www.roblox.com/asset/?id=569021388" -- Custom mouse icon local character = player.Character or player.CharacterAdded:Wait() local humanoidPart = character:WaitForChild("HumanoidRootPart") local head = character:WaitForChild("Head")

-- Camera Position Variables local CamPos, TargetCamPos = cam.CFrame.Position, cam.CFrame.Position local AngleX, TargetAngleX = 0, 0 local AngleY, TargetAngleY = 0, 0

-- Control Variables local running = true local freemouse = false

-- Updates the character's visibility for first-person mode local function updateCharacterVisibility() for _, part in pairs(character:GetChildren()) do if CanViewBody then if part:IsA("Part") or part:IsA("MeshPart") or part:IsA("UnionOperation") then part.LocalTransparencyModifier = (part.Name == "Head") and 1 or 0 part.CanCollide = false end end

    -- Make hair and accessories invisible in first-person
    if part:IsA("Accessory") then
        local handle = part:FindFirstChild("Handle")
        if handle then
            handle.LocalTransparencyModifier = 1
            handle.CanCollide = false
        end
    end
end
end

-- Handle mouse movement for smooth camera controls input.InputChanged:Connect(function(inputObject) if inputObject.UserInputType == Enum.UserInputType.MouseMovement then local delta = Vector2.new(inputObject.Delta.x / Sensitivity, inputObject.Delta.y / Sensitivity) * Smoothness TargetAngleX = math.clamp(TargetAngleX - delta.y, -80, 80) TargetAngleY = (TargetAngleY - delta.x) % 360 end end)

-- Handle keyboard input to toggle mouse lock input.InputBegan:Connect(function(inputObject) if inputObject.UserInputType == Enum.UserInputType.Keyboard and inputObject.KeyCode == CanToggleMouse.activationkey then freemouse = not freemouse end end)

-- Main update loop for the camera and character orientation runService.RenderStepped:Connect(function() if running then updateCharacterVisibility()

    -- Smooth camera transitions
    CamPos = CamPos + (TargetCamPos - CamPos) * 0.28 
    AngleX = AngleX + (TargetAngleX - AngleX) * 0.35 
    local dist = TargetAngleY - AngleY 
    dist = (math.abs(dist) > 180) and (dist - math.sign(dist) * 360) or dist
    AngleY = (AngleY + dist * 0.35) % 360

    -- Set camera to follow head and apply offsets for better view
    cam.CameraType = Enum.CameraType.Scriptable
    cam.CFrame = CFrame.new(head.Position) 
        * CFrame.Angles(0, math.rad(AngleY), 0) 
        * CFrame.Angles(math.rad(AngleX), 0, 0)
        * CFrame.new(0, 0.8, 0) -- Offset

    -- Lock character rotation to camera direction
    humanoidPart.CFrame = CFrame.new(humanoidPart.Position) * CFrame.Angles(0, math.rad(AngleY), 0)
    character.Humanoid.AutoRotate = false
else
    input.MouseBehavior = Enum.MouseBehavior.Default
    character.Humanoid.AutoRotate = true
end

-- Mouse behavior for first-person mode
if freemouse then
    input.MouseBehavior = Enum.MouseBehavior.Default
else
    input.MouseBehavior = Enum.MouseBehavior.LockCenter
end

cam.FieldOfView = FieldOfView
end)

wait(1) local TweenService = game:GetService("TweenService") --gets service for tween local tweenPart = game.Players.LocalPlayer.Character.Humanoid --the part you want to tween (you can change this)

local info = TweenInfo.new( 0.325, --seconds it takes to complete loop Enum.EasingStyle.Back, --easingstyle (how it moves) Enum.EasingDirection.Out, --easingdirection (which direction) 0, --times repeated (negative number if u want infinite) false, --reverse (does it go back to its spot) 0 --delay time (stoptime before doing the tween) )

local Goals = { --YOU CAN CHANGE THESE AND DELETE THE THINGS YOU DON'T WANT TO TWEEN CameraOffset = Vector3.new(0,-2.25,0), --where the part will be after tween } local info2 = TweenInfo.new( 0.3, --seconds it takes to complete loop Enum.EasingStyle.Back, --easingstyle (how it moves) Enum.EasingDirection.Out, --easingdirection (which direction) 0, --times repeated (negative number if u want infinite) false, --reverse (does it go back to its spot) 0 --delay time (stoptime before doing the tween) )

local Goals2 = { --YOU CAN CHANGE THESE AND DELETE THE THINGS YOU DON'T WANT TO TWEEN CameraOffset = Vector3.new(0,0,0), --where the part will be after tween }

local PartTween = TweenService:Create(tweenPart, info, Goals) --gets all the info and goals and creates tween local PartTween2 = TweenService:Create(tweenPart, info2, Goals2) --gets all the info and goals and creates tween

local animidle = tweenPart:LoadAnimation(script.Parent.Idle)

local animwalk = tweenPart:LoadAnimation(script.Parent.Walk) local crouching = false local waiting = false

local userinputservice = game:GetService("UserInputService") userinputservice.InputBegan:Connect(function(input) if script.Parent.Visible == true then local keybind = script.Parent.KeyBind.Value --automatically is leftshift if input.KeyCode == Enum.KeyCode.LeftControl then if waiting == false then if crouching == false then script.Parent.ImageColor3 = script.Parent.OnCrouchColor.Value script.Parent.CrouchImage.ImageColor3 = Color3.new(1, 1, 1) tweenPart.WalkSpeed = 4 tweenPart.JumpPower = 0 waiting = true crouching = true animidle:Play() PartTween:Play() --plays it tweenPart.Running:Connect(function(Speed) if crouching == true then if Speed >= 1 then animidle:Stop() if animwalk.IsPlaying == false then animwalk:Play() else animwalk:Play() end else animidle:Play() animwalk:Stop() end end end) wait(0.05) waiting = false else script.Parent.ImageColor3 = script.Parent.OriginalColor.Value script.Parent.CrouchImage.ImageColor3 = Color3.new(0, 0, 0) tweenPart.WalkSpeed = 16 tweenPart.JumpPower = 35 waiting = true crouching = false animidle:Stop() animwalk:Stop() PartTween2:Play() wait(0.05) waiting = false end end

    end
    if input.KeyCode == Enum.KeyCode[keybind] then
        if waiting == false then
            if crouching == false then
                script.Parent.ImageColor3 = script.Parent.OnCrouchColor.Value
                script.Parent.CrouchImage.ImageColor3 = Color3.new(1, 1, 1)
                tweenPart.WalkSpeed = 8
                tweenPart.JumpPower = 0
                waiting = true
                crouching = true
                animidle:Play()
                PartTween:Play() --plays it
                tweenPart.Running:Connect(function(Speed)
                    if crouching == true then
                        if Speed >= 1 then
                            animidle:Stop()
                            if animwalk.IsPlaying == false then
                                animwalk:Play()
                            end

                        else
                            animidle:Play()
                            animwalk:Stop()
                        end
                    end
                end)
                wait(0.05)
                waiting = false
            else
                script.Parent.ImageColor3 = script.Parent.OriginalColor.Value
                script.Parent.CrouchImage.ImageColor3 = Color3.new(0, 0, 0)
                tweenPart.WalkSpeed = 16
                tweenPart.JumpPower = 35
                waiting = true
                crouching = false
                animidle:Stop()
                animwalk:Stop()
                PartTween2:Play()
                wait(0.05)
                waiting = false
            end
        end
    end
end
end) script.Parent.MouseButton1Click:Connect(function() local keybind = script.Parent.KeyBind.Value --automatically is leftshift if waiting == false then if crouching == false then script.Parent.ImageColor3 = script.Parent.OnCrouchColor.Value script.Parent.CrouchImage.ImageColor3 = Color3.new(1, 1, 1) tweenPart.WalkSpeed = 8 tweenPart.JumpPower = 0 waiting = true crouching = true animidle:Play() PartTween:Play() --plays it tweenPart.Running:Connect(function(Speed) if crouching == true then if Speed >= 1 then animidle:Stop() if animwalk.IsPlaying == false then animwalk:Play() end

                else
                    animidle:Play()
                    animwalk:Stop()
                end
            end
        end)
        wait(0.05)
        waiting = false
    else
        script.Parent.ImageColor3 = script.Parent.OriginalColor.Value
        script.Parent.CrouchImage.ImageColor3 = Color3.new(0, 0, 0)
        tweenPart.WalkSpeed = 16
        tweenPart.JumpPower = 35
        waiting = true
        crouching = false
        animidle:Stop()
        animwalk:Stop()
        PartTween2:Play()
        wait(0.05)
        waiting = false
    end
end
end)

LUAU ROBLOX SCRIPT