Ummm, whats the lua errror?

/script LeaveParty() should work (it should since a lot of addons are using exactly that)