Weird Error

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

anyone know hot to fix it, im using the mega, and i only got this after installing bluetooth on my computer.

There's a really good chance that the bluetooth is interfering with serial communications. It happens quite frequently. Disconnect/disable the bluetooth stuff, and see if it resolves your problem.

It only happens with some programs,i just unplugged the protesheild and it worked. I dont have a clue y

Could be that the bluetooth software you installed only checks for connections at certain intervals. Between checks, you can use the COM port. During a check, you can't, resulting in the communications error you are getting.