Had a ideer for a A/C system

I cant remember how all the ac components work, but I believe part of the cooling of the air is when the refrigerant changes state.....liquid to gas then back to liquid again.....I think
When you compress the gas (in this case it goes to a liquid state) it heats up. Then you cool it off to ambient temp.
That heat energy from cooling it off is now gone from the system.

Then when it expands out and becomes a gas again, the temp drops. It doesn't necessarily have to become a gas, but that does help the process. Just like when you compress something and it heats up(releases heat TO the environment), if you decompress it, it cools off (absorbs heat from the environment). Remember, "heat" only flows from hot to cold.

Since the system cooled off, it absorbs heat from its surroundings (Like, the cabin of your car).

Simple! The change from liquid to gas and back certainly helps, but is not required. The change from liquid to gas is the precise (and only) mechanism that swamp coolers operate on. The efficiency of phase change varies depending on some variables, but as mentioned, it's a part of it.