Head look script going messy when looking at a player or the sky?

yes its me again and yet i found issues with my script, no console output, neck going messy while looking at sky OR a npc / player

this is the local script

local remote = game.ReplicatedStorage:WaitForChild("dkskdkkd")
game["Run Service"].RenderStepped:Connect(function()
local torso = char.Torso
local mouse = a:GetMouse()
local rightS = char.Torso["Right Shoulder"]
local leftS = char.Torso["Left Shoulder"]
local Neck = char.Torso["Neck"]
local hit = (torso.Position.Y - mouse.Hit.Position.Y)
	local mag = (torso.Position - mouse.Hit.Position).Magnitude
	local offset = hit/mag
	local c1 = (CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.fromEulerAnglesXYZ(0, 0, -offset))
	local c2 = (CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, offset))
	local c3 = (CFrame.new(0, 1, 0, -0, -0, 0, 0, 0, 0, 0, 1, 0) * CFrame.fromEulerAnglesXYZ(offset, 0, 0))
	if mouse.Target then
		if mouse.Target.Name == "Effect" or mouse.Target.Name == "Projectile" or mouse.Target.Name == nil or mouse.Target == nil then return end
		remote:FireServer(a,c1,c2,c3)
	else
		--nothing
		end
--[[
rightS.C0 = rightS.C0:Lerp(CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.fromEulerAnglesXYZ(0, 0, -offset),0.3)
leftS.C0 = leftS.C0:Lerp(CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, offset),0.3)
Neck.C0 = Neck.C0:Lerp(CFrame.new(0, 1, 0, -0, -0, 0, 0, 0, 0, 0, 1, 0) * CFrame.fromEulerAnglesXYZ(offset, 0, 0),0.3)
-]]
	end)

i honestly dont know if its coming from server script or local.

so uh? hello?

im waiting for someone’s response.

Not everyone can help with this kind of problem. Only 20 minutes to wait for a response isn’t bad. Plus it’s 2am

i dont think there will be a response.

not any response either? i was waiting like 4 hours and got no response.

I know how to solve your problem but I refuse because you’re so impatient :smiling_face:

This is not a professional way to respond.

I don’t know how to solve it, but I think it has something to do with the CFrames.

your saying it like you are going to take cash and never bring a burger and just quit the job

if you are saying im inpatient why reply?

What does your server script do?

--local remote = game.ReplicatedStorage:WaitForChild("dkskdkkd")
local player = game.Players.LocalPlayer
local char = script.Parent
game["Run Service"].RenderStepped:Connect(function()
local torso = char.UpperTorso

local mouse = player:GetMouse()
local rightS = char["RightUpperArm"].RightShoulder
local leftS = char["LeftUpperArm"].LeftShoulder
local Neck = char.Head["Neck"]
local hit = (torso.Position.Y - mouse.Hit.Position.Y)
local mag = (torso.Position - mouse.Hit.Position).Magnitude

local offset = hit/mag

local c1 = (CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.fromEulerAnglesXYZ(0, 0, -offset))
local c2 = (CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, offset))
local c3 = (CFrame.new(0, 1, 0, -0, -0, 0, 0, 0, 0, 0, 1, 0) * CFrame.fromEulerAnglesXYZ(offset, 0, 0))

if mouse.Target then
if mouse.Target.Name == "Effect" or mouse.Target.Name == "Projectile" or mouse.Target.Name == nil or mouse.Target == nil then return end
--remote:FireServer(a,c1,c2,c3)

else

--nothing

end

rightS.C0 = rightS.C0:Lerp(CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.fromEulerAnglesXYZ(0, 0, -offset),0.3)
leftS.C0 = leftS.C0:Lerp(CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, offset),0.3)
Neck.C0 = Neck.C0:Lerp(CFrame.new(0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0) * CFrame.fromEulerAnglesXYZ(-offset, 0, 0),0.3)

end)

Where’d you get this script?