Urgent Help needed for a script

Hi, I was making the script for the camera of an extinguisher but It isnt working, The extinguisher doesnt even move and It goes invisible if you look up.

local Players = game:GetService("Players")
local ContextActionService = game:GetService("ContextActionService")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
 local revolver = script.Parent
local camera = workspace.CurrentCamera

local player = Players.LocalPlayer
 
	revolver.Equipped:Connect(function()
		print("equped")
			local RunService = game:GetService("RunService")
local Player = game.Players.LocalPlayer

local PlayerMouse = Player:GetMouse()



local Camera = workspace.CurrentCamera



local Character = Player.Character or Player.CharacterAdded:Wait()

local Head = Character:WaitForChild("Head")

local Neck = Head:WaitForChild("Neck")



local Arm = Character:WaitForChild("RightUpperArm")

local Shoulder = Arm:WaitForChild("RightShoulder")



local Humanoid = Character:WaitForChild("Humanoid")

local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")



local NeckOriginC0 = Neck.C0

local ShoulderOriginC0 = Shoulder.C0



Neck.MaxVelocity = 1/3



RunService.RenderStepped:Connect(function()

	local CameraCFrame = Camera.CoordinateFrame

	

				if Character:FindFirstChild("UpperTorso") and Character:FindFirstChild("Head") and (camera.focus.Position - camera.CoordinateFrame.Position).magnitude <= 1 then

		local ArmLookVector = Arm.CFrame.lookVector

		local HeadPosition = Head.CFrame.p

		

	if Neck and Shoulder and (camera.focus.Position - camera.CoordinateFrame.Position).magnitude <= 1 then

			if Camera.CameraSubject:IsDescendantOf(Character) or Camera.CameraSubject:IsDescendantOf(Player) then

				local Point = PlayerMouse.Hit.p
	

				local Distance = (Head.CFrame.p - Point).magnitude

				local Difference = Head.CFrame.Y - Point.Y

				Shoulder.C0 = Shoulder.C0:lerp(ShoulderOriginC0 * CFrame.Angles(-(math.asin(Difference / Distance)), (((HeadPosition - Point).Unit):Cross(ArmLookVector)).Y, 0), .5 / 2)


		end

	end	

			end
			end)
			
			
	end)

	
	

There are a few issues in your script that might be causing the problems you mentioned. Let’s go through them and make the necessary adjustments:

  1. First, make sure that you have the necessary permissions to access the required services. You need to be a LocalScript within the StarterPlayerScripts or a descendant of the player’s character.
  2. Remove the duplicate declaration of the RunService variable. You only need to declare it once at the beginning of your script.
  3. The Camera variable should refer to workspace.CurrentCamera, not game.Workspace.CurrentCamera.
  4. Avoid using wait() or other blocking operations in your event connections, as they can cause performance issues or freeze the game. Instead, you can use :Wait() on a separate line before connecting the events.
  5. The Camera.CameraSubject check might not be necessary in this case. Since you’re already checking if the player’s head and upper torso exist, you can assume the camera is focusing on the player.