input.InputChanged:connect(function(g)if g.UserInputType==Enum.UserInputType.MouseMovement then local L=Vector2.new(g.Delta.x/Sensitivity,g.Delta.y/Sensitivity)*Smoothness local m=TargetAngleX-L.y TargetAngleX=m>=80 and 80 or m<=-80 and-80 or m TargetAngleY=(TargetAngleY-L.x)%360 end end)input.InputBegan:connect(function(g)if g.UserInputType==Enum.UserInputType.Keyboard then if g.KeyCode==CanToggleMouse.activationkey then if CanToggleMouse.allowed and freemouse==false then freemouse=true else freemouse=false end end end end)


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

		local X = TargetAngleX - delta.y 
		TargetAngleX = (X >= 80 and 80) or (X <= -80 and -80) or X 
		TargetAngleY = (TargetAngleY - delta.x) %360 
	end	
	
end)

input.InputBegan:connect(function(inputObject)
	
	if inputObject.UserInputType == Enum.UserInputType.Keyboard then
		if inputObject.KeyCode == CanToggleMouse.activationkey then
			if CanToggleMouse.allowed and freemouse == false then
				freemouse = true
			else
				freemouse = false
			end
		end
	end
	
end)
