do the positive ions or the negative ions cause the change in flame color?

Mostly positive.

can you please explain why

I don't think it's a matter of which ions are excited versus those that are not as much as it is the color. Atoms/ions that are used in flame emission are there primarily for three reasons:

1. They are easily volatilized in a flame and
2. They emit energy that places the wavelength in the visible part of the spectrum and
3. The lines they emit in the visible part of the spectrum are very intense.
You will notice also that most of the useful one for flame spectroscopy are low in the periodic table such as Na K Li etc.
Cl^-, Br^- etc are volatilized in the flame, also, but there are no STRONG (intense) lines in the visible region of the spectrum as in Na, K, etc.
By the way, you may find it interesting to know that the green line for Ba and the red line for Sr are NOT due to Ba and Sr but they are band spectra of BaO and SrO.

damn this was 2013 so long ago

The change in flame color is primarily caused by the presence of positive ions in a substance. When an element is heated, its electrons become excited and jump to higher energy levels. As they return to their original energy levels, they release energy in the form of light. The specific spectral lines of light emitted depend on the element present in the substance.

To determine whether positive or negative ions cause the change in flame color, you can perform a simple experiment. Start by preparing a clean and non-flammable surface to work on, such as a ceramic tile or a fireproof mat. Then, light a Bunsen burner or a gas stove and adjust it to produce a clean, blue flame.

Next, introduce a small quantity of a solid or a solution containing an element with known flame color characteristics. For example, you can use a small amount of table salt (sodium chloride) or a solution of copper sulfate.

Now, observe the flame color as you introduce the substance to the flame. If the flame changes color, it indicates that positive ions are responsible for the color change. This is because elements typically undergo ionization when heated, and it is the positively charged ions that release the energy in the form of light.

By performing this experiment with different substances, you can observe a variety of flame colors corresponding to different elements. This supports the conclusion that positive ions are primarily responsible for the change in flame color.