kill_object_event = CreateMouseEvent(function (id,x,y)
	for _, o in pairs(object(0,"table")) do
		if object(o,"tilex") == math.floor(x/32) and object(o,"tiley") == math.floor(y/32) then
			parse("killobject "..o)
			break
		end
	end
	USERTEMP[id]["mouseevent"] = nil
end)
CreateMouseFunc("Destroy object", kill_object_event)