i was following this tutorial:
and i got this error for line 35 "invalid set index 'rotate_x' (on base: node3d) with value of type 'float'."

code:
extends CharacterBody3D

#///basic variables///

var gravity = -30
var max_speed = 8
var mouse_sensitivity = 0.002

#///gun variables///

#///functions///

func _ready():
Input.set_mouse_mode(Input. MOUSE_MODE_CAPTURED)

func get_input():
var input_dir = Vector3()
if Input.is_action_pressed("move_foward"):
input_dir += -global_transform.basis.z
if Input.is_action_pressed("move_back"):
input_dir -= -global_transform.basis.z
if Input.is_action_pressed("strafe_left"):
input_dir += -global_transform.basis.x
if Input.is_action_pressed("strafe_right"):
input_dir -= -global_transform.basis.x
#input_dir = input_dir.normalized() #add to cancel strafe running
return input_dir

func _unhandled_input(event):
if event is InputEventMouseMotion:
rotate_y(-event.relative.y * mouse_sensitivity)
$Pivot.rotate_x(-event.relative.x * mouse_sensitivity)
$Pivot.rotate_x = clamp($Pivot.rotation.x, -1.2, 1.2)

func _physics_process(delta):
#gravity
#velocity.y += gravity * delta
var desired_velocity = get_input() * max_speed
velocity.x = desired_velocity.x
velocity.z = desired_velocity.z
#velocity = move_and_slide(velocity, Vector3.UP, true)
move_and_slide()

func change_gun(gun):
pass

func _process(delta):
pass

    JetteBoyTV $Pivot.rotate_x = clamp($Pivot.rotation.x, -1.2, 1.2)

    rotate_x is a method, but you're assigning a value to it as if it's a property.
    you call the method(like you did in the line directly above it) with:
    $Pivot.rotate_x(clamp($Pivot.rotation.x, -1.2, 1.2)
    if you were meant to assign to the rotation property instead:
    $Pivot.rotation.x = (clamp($Pivot.rotation.x, -1.2, 1.2)

    JetteBoyTV maybe start over with a godot 4 tutorial?
    most of these problems could've been avoided by creating a new script and selecting the CharacterBody3D template.
    this code is no good:

    func get_input():
         var input_dir = Vector3()
         if Input.is_action_pressed("move_foward"):
              input_dir += -global_transform.basis.z
         if Input.is_action_pressed("move_back"):
              input_dir -= -global_transform.basis.z
         if Input.is_action_pressed("strafe_left"):
              input_dir += -global_transform.basis.x
         if Input.is_action_pressed("strafe_right"):
              input_dir -= -global_transform.basis.x
         #input_dir = input_dir.normalized() #add to cancel strafe running
         return input_dir

    if you need an fps tutorial, StayAtHomeDev has a decent one: