DnD Killing your teammates

i have a question, is there some way of killing your teammates, while not getting them angry in real life?

We have a party where we didn’t accomplished any of the tasks, we have just destroyed a city, nearly killing 1000 people in the other. So the very first quest giver is now upset about our party. My character was killed, and I came up with the idea of a new character – spy for the quest giver. And very first task I was given is to "guide" the party to finishing the original quest and killing them after (they really had it coming). So the actual question – is there a way to killing them, so they are having chance to survive or die (players would be engaged and it would be really dangerous), or still have some fun.